Skip to content

Instantly share code, notes, and snippets.

@Nani-o
Last active January 9, 2020 15:18
Show Gist options
  • Select an option

  • Save Nani-o/b639d491d0d4b30cf543281a3f26e0aa to your computer and use it in GitHub Desktop.

Select an option

Save Nani-o/b639d491d0d4b30cf543281a3f26e0aa to your computer and use it in GitHub Desktop.

The update went fine, when you look it downloads my role

Project Update :

Identity added: /tmp/awx_92_7hm0ne75/artifacts/92/ssh_key_data (/tmp/awx_92_7hm0ne75/artifacts/92/ssh_key_data)
Using /etc/ansible/ansible.cfg as config file

PLAY [all] *********************************************************************

TASK [delete project directory before update] **********************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [update project using git] ************************************************
ok: [localhost, -> localhost] => {"after": "3af73e93ce272c56d885fb3586fff8ac9c15d8d7", "before": "3af73e93ce272c56d885fb3586fff8ac9c15d8d7", "changed": false, "remote_url_changed": false}

TASK [Set the git repository version] ******************************************
ok: [localhost, -> localhost] => {"ansible_facts": {"scm_version": "3af73e93ce272c56d885fb3586fff8ac9c15d8d7"}, "changed": false}

TASK [update project using hg] *************************************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [Set the hg repository version] *******************************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [parse hg version string properly] ****************************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [update project using svn] ************************************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [Set the svn repository version] ******************************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [parse subversion version string properly] ********************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [Ensure the project directory is present] *********************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [Fetch Insights Playbook(s)] **********************************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [Save Insights Version] ***************************************************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [Repository Version] ******************************************************
ok: [localhost,] => {
    "msg": "Repository Version 3af73e93ce272c56d885fb3586fff8ac9c15d8d7"
}

PLAY [all] *********************************************************************

TASK [detect requirements.yml] *************************************************
ok: [localhost, -> localhost] => {"changed": false, "stat": {"atime": 1578579230.2607422, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "unknown", "checksum": "8b2df1f86f8ddb442cb35cf8a2cd924e6151989d", "ctime": 1578579229.344763, "dev": 164, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 184451, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "unknown", "mode": "0644", "mtime": 1578579229.344763, "nlink": 1, "path": "/var/lib/awx/projects/_8__command_center/roles/requirements.yml", "pw_name": "root", "readable": true, "rgrp": true, "roth": true, "rusr": true, "size": 181, "uid": 0, "version": null, "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}}

TASK [fetch galaxy roles from requirements.yml] ********************************
changed: [localhost, -> localhost] => {"changed": true, "cmd": ["ansible-galaxy", "install", "-r", "requirements.yml", "-p", "/tmp/awx_90_9q2g___v/requirements_roles", "-v"], "delta": "0:00:01.040115", "end": "2020-01-09 14:19:28.566622", "rc": 0, "start": "2020-01-09 14:19:27.526507", "stderr": "", "stderr_lines": [], "stdout": "Using /etc/ansible/ansible.cfg as config file\\n- extracting mpe-front to /tmp/awx_90_9q2g___v/requirements_roles/mpe-front\\n- mpe-front (v3.2) was installed successfully", "stdout_lines": ["Using /etc/ansible/ansible.cfg as config file", "- extracting mpe-front to /tmp/awx_90_9q2g___v/requirements_roles/mpe-front", "- mpe-front (v3.2) was installed successfully"]}

TASK [detect collections/requirements.yml] *************************************
ok: [localhost, -> localhost] => {"changed": false, "stat": {"exists": false}}

TASK [fetch galaxy collections from collections/requirements.yml] **************
skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}

PLAY RECAP *********************************************************************
localhost,                 : ok=6    changed=1    unreachable=0    failed=0    skipped=13   rescued=0    ignored=0   

When you connect into the awx_task container, I can see my role :

tree -L 1 /var/lib/awx/projects/_8__command_center/roles/
/var/lib/awx/projects/_8__command_center/roles/
├── mpe-front
└── requirements.yml

1 directory, 1 file

I then run a playbook that does that :

---
- hosts: localhost
  tasks:
    - shell: "tree {{ playbook_dir }}/../"
      register: myvar
    - debug:
        var: myvar
...

So that I can look the folders that are present or not, and in the output I have :

        "stdout_lines": [
            "/tmp/awx_94_1wlgr1s4/project/plays/../",
            "├── ansible.cfg",
            "├── filter_plugins",
            "│   ├── extractor.py",
            "│   ├── __pycache__",
            "│   │   ├── extractor.cpython-36.pyc",
            "│   │   └── sublistextractor.cpython-36.pyc",
            "│   └── sublistextractor.py",
            "├── inventory",
[...]
            "├── plays",
            "│   ├── roles -> ../roles",
            "│   ├── test.yml",
            "├── README.md",
[...]
            "├── roles",
            "│   └── requirements.yml",
            "",
            "781 directories, 1422 files"
        ]
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment