Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pull latest version #65

Closed
Lithimlin opened this issue Oct 27, 2021 · 3 comments
Closed

Cannot pull latest version #65

Lithimlin opened this issue Oct 27, 2021 · 3 comments

Comments

@Lithimlin
Copy link
Contributor

When I try to call the roll with `promtail_version: "latest", the installation task fails with the following:

TASK [patrickjahns.promtail : Assert usage of systemd as an init system] *************************************************************************************
ok: [host] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [patrickjahns.promtail : Get latest release] ************************************************************************************************************
fatal: [host]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}

I'm fairly new to ansible so unfortunately I can't really say what exactly is going wrong/how to retrieve more information.
Specifying the version directly works.

@patrickjahns
Copy link
Owner

Thanks for reporting the issue - I've re-run the ansible molecule test suites and see it working as expected (see below)

molecule test run
 tox -e ansible43 -- molecule test -s latest
ansible43 installed: ansible==4.3.0,ansible-compat==0.5.0,ansible-core==2.11.6,arrow==1.2.1,attrs==21.2.0,bcrypt==3.2.0,binaryornot==0.4.4,Cerberus==1.3.2,certifi==2021.10.8,cffi==1.15.0,chardet==4.0.0,charset-normalizer==2.0.7,click==8.0.3,click-help-colors==0.9.1,colorama==0.4.4,commonmark==0.9.1,cookiecutter==1.7.3,cryptography==35.0.0,docker==5.0.3,enrich==1.2.6,flake8==4.0.1,idna==3.3,iniconfig==1.1.1,Jinja2==3.0.2,jinja2-time==0.2.0,MarkupSafe==2.0.1,mccabe==0.6.1,molecule==3.5.2,molecule-docker==1.1.0,packaging==21.2,paramiko==2.8.0,pluggy==1.0.0,poyo==0.5.0,py==1.10.0,pycodestyle==2.8.0,pycparser==2.20,pyflakes==2.4.0,Pygments==2.10.0,PyNaCl==1.4.0,pyparsing==2.4.7,pytest==6.2.5,pytest-testinfra==6.4.0,python-dateutil==2.8.2,python-slugify==5.0.2,PyYAML==5.4.1,requests==2.26.0,resolvelib==0.5.4,rich==10.12.0,six==1.16.0,subprocess-tee==0.3.5,text-unidecode==1.3,toml==0.10.2,urllib3==1.26.7,websocket-client==1.2.1
ansible43 run-test-pre: PYTHONHASHSEED='3753720445'
ansible43 run-test: commands[0] | molecule test -s latest
INFO     latest scenario test matrix: dependency, lint, cleanup, destroy, syntax, create, prepare, converge, idempotence, side_effect, verify, cleanup, destroy
INFO     Performing prerun...
INFO     Added ANSIBLE_LIBRARY=/Users/pjahns/.cache/ansible-compat/e75346/modules:/Users/pjahns/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO     Added ANSIBLE_COLLECTIONS_PATH=/Users/pjahns/.cache/ansible-compat/e75346/collections:/Users/pjahns/.ansible/collections:/usr/share/ansible/collections
INFO     Added ANSIBLE_ROLES_PATH=/Users/pjahns/.cache/ansible-compat/e75346/roles:/Users/pjahns/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO     Using /Users/pjahns/.ansible/roles/patrickjahns.promtail symlink to current repository in order to enable Ansible to find the role using its expected full name.
INFO     Running latest > dependency
WARNING  Skipping, missing the requirements file.
WARNING  Skipping, missing the requirements file.
INFO     Running latest > lint
COMMAND: set -e
yamllint .
flake8

INFO     Running latest > cleanup
WARNING  Skipping, cleanup playbook not configured.
INFO     Running latest > destroy
INFO     Sanity checks: 'docker'

PLAY [Destroy] *****************************************************************

TASK [Destroy molecule instance(s)] ********************************************
changed: [localhost] => (item=instance)

TASK [Wait for instance(s) deletion to complete] *******************************
ok: [localhost] => (item=instance)

TASK [Delete docker networks(s)] ***********************************************

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0

INFO     Running latest > syntax

playbook: /Users/pjahns/projects/private/ansible-role-promtail/molecule/latest/playbook.yml
INFO     Running latest > create

PLAY [Create] ******************************************************************

TASK [Log into a Docker registry] **********************************************
skipping: [localhost] => (item=None)
skipping: [localhost]

TASK [Check presence of custom Dockerfiles] ************************************
ok: [localhost] => (item={'command': '', 'image': 'geerlingguy/docker-ubuntu1804-ansible:latest', 'name': 'instance', 'pre_build_image': True, 'privileged': True, 'volumes': ['/sys/fs/cgroup:/sys/fs/cgroup:ro']})

TASK [Create Dockerfiles from image names] *************************************
skipping: [localhost] => (item={'command': '', 'image': 'geerlingguy/docker-ubuntu1804-ansible:latest', 'name': 'instance', 'pre_build_image': True, 'privileged': True, 'volumes': ['/sys/fs/cgroup:/sys/fs/cgroup:ro']})

TASK [Discover local Docker images] ********************************************
ok: [localhost] => (item={'changed': False, 'skipped': True, 'skip_reason': 'Conditional result was False', 'item': {'command': '', 'image': 'geerlingguy/docker-ubuntu1804-ansible:latest', 'name': 'instance', 'pre_build_image': True, 'privileged': True, 'volumes': ['/sys/fs/cgroup:/sys/fs/cgroup:ro']}, 'ansible_loop_var': 'item', 'i': 0, 'ansible_index_var': 'i'})

TASK [Build an Ansible compatible image (new)] *********************************
skipping: [localhost] => (item=molecule_local/geerlingguy/docker-ubuntu1804-ansible:latest)

TASK [Create docker network(s)] ************************************************

TASK [Determine the CMD directives] ********************************************
ok: [localhost] => (item={'command': '', 'image': 'geerlingguy/docker-ubuntu1804-ansible:latest', 'name': 'instance', 'pre_build_image': True, 'privileged': True, 'volumes': ['/sys/fs/cgroup:/sys/fs/cgroup:ro']})

TASK [Create molecule instance(s)] *********************************************
changed: [localhost] => (item=instance)

TASK [Wait for instance(s) creation to complete] *******************************
FAILED - RETRYING: Wait for instance(s) creation to complete (300 retries left).
changed: [localhost] => (item={'started': 1, 'finished': 0, 'ansible_job_id': '982883763634.34994', 'results_file': '/Users/pjahns/.ansible_async/982883763634.34994', 'changed': True, 'failed': False, 'item': {'command': '', 'image': 'geerlingguy/docker-ubuntu1804-ansible:latest', 'name': 'instance', 'pre_build_image': True, 'privileged': True, 'volumes': ['/sys/fs/cgroup:/sys/fs/cgroup:ro']}, 'ansible_loop_var': 'item'})

PLAY RECAP *********************************************************************
localhost                  : ok=5    changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0

INFO     Running latest > prepare

PLAY [Prepare] *****************************************************************

TASK [Gathering Facts] *********************************************************
ok: [instance]

TASK [Ensure that net-tools is available] **************************************
skipping: [instance]

PLAY RECAP *********************************************************************
instance                   : ok=1    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0

INFO     Running latest > converge

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

TASK [Gathering Facts] *********************************************************
ok: [instance]

TASK [ansible-role-promtail : Assert usage of systemd as an init system] *******
ok: [instance] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [ansible-role-promtail : Get latest release] ******************************
ok: [instance]

TASK [ansible-role-promtail : Set promtail version to 2.3.0] *******************
ok: [instance]

TASK [ansible-role-promtail : Get checksum list] *******************************
ok: [instance]

TASK [ansible-role-promtail : Get checksum for amd64 architecture] *************
skipping: [instance] => (item=7a3255f06cd51e09188f5099d4862ac56981af65ade5e4f46b8b9c56eaf3332a  logcli-darwin-amd64.zip)
skipping: [instance] => (item=791274edf8b983f0eb7c9270612439b76dc5860fad468df1158d6dd5c86ecde4  logcli-freebsd-amd64.zip)
skipping: [instance] => (item=af0d748ac29da9f7d43d5e7675996ab331112024fa06d65e82996925f5882658  logcli-linux-amd64.zip)
skipping: [instance] => (item=4197493bff88789a6ad623fedecf5fab0f075c325c4a1c6ca640a0fc068efd21  logcli-linux-arm.zip)
skipping: [instance] => (item=4659f99e10924e4c5e2a4567f80806967c61000cc56ea67ce2b7984c3b8e6e83  logcli-linux-arm64.zip)
skipping: [instance] => (item=8a12bbc138294669bad303c94f65934ceb9c6c3853e46ed248f258c2aeeaa582  logcli-windows-amd64.exe.zip)
skipping: [instance] => (item=042aa01bd242f12b8481e1024f5e3e53169bf14c30937f0b6a568ca8faf0dc24  loki-canary-darwin-amd64.zip)
skipping: [instance] => (item=eb5e5bec76fdff08aeb40815c73f924c4af88720f1d37a727df147ff7aee5c15  loki-canary-freebsd-amd64.zip)
skipping: [instance] => (item=e55569ab6d176ea46680245b20246855deee84c028a7dc1c743b6fb0765341a0  loki-canary-linux-amd64.zip)
skipping: [instance] => (item=5e874da75fa1882d81136d8dd1683930cc50984c1d1fbe83fcd95d4c74e22425  loki-canary-linux-arm.zip)
skipping: [instance] => (item=9b66e23d17115f8306ccb663a5414e7d2f6e47527cab5711468568ad67644831  loki-canary-linux-arm64.zip)
skipping: [instance] => (item=80f23470057c40f01378cdc9d9ac4ef7b35c1590e7860bcc0af32b79bd181b61  loki-canary-windows-amd64.exe.zip)
skipping: [instance] => (item=74e8f05c2dba7c9d67f4234121537485621023d609411ddf9eab4b26af50c349  loki-darwin-amd64.zip)
skipping: [instance] => (item=788b822c7086ee5ea2ead62484f942418c97db22031d708dee03c30933b4463b  loki-freebsd-amd64.zip)
skipping: [instance] => (item=e3cfcdd67fc23f2707eea64b200eada2d8d12864a7052b9482d56fdeae989b3c  loki-linux-amd64.zip)
skipping: [instance] => (item=33d1bcb59e4c2cb94d122476b340f0f85da20dcb05b34a42f766f19bb3529e35  loki-linux-arm.zip)
skipping: [instance] => (item=4ebac8660f2989b3e01fc0eb9334a243be0a87143e192a10ea289f20fbd50b69  loki-linux-arm64.zip)
skipping: [instance] => (item=fa4324458dd133711988d44ceacaeaf6f3d8861a522a400df6c8dfdc1792e89d  loki-windows-amd64.exe.zip)
skipping: [instance] => (item=097fd86317e7922c833a0b2883c5e113a2edcfb23b0c8eabd404f6a76937f6a4  promtail-darwin-amd64.zip)
skipping: [instance] => (item=18895f9f5ef288168451d3cafe39f11199d67619415841d56d28f2b35b4a6f2c  promtail-freebsd-amd64.zip)
ok: [instance] => (item=9ca9f0bf63bec77664d3b62110107d2430c43137943a70713c6f11fa23d48130  promtail-linux-amd64.zip)
skipping: [instance] => (item=c4799ac77875045c959970f332492da2800d6640cd97347d93418b8910783b37  promtail-linux-arm.zip)
skipping: [instance] => (item=e633a378dc88a12138b552c9e3f822b6ae6c2405d5aae11aafd57fa9ed362168  promtail-linux-arm64.zip)
skipping: [instance] => (item=1c5034f3f8e667dd9e7310f7aaeadfea0208690eabd933381adaaadcca758b88  promtail-windows-386.exe.zip)
skipping: [instance] => (item=30b6f1908191e5e6dc68a970a53e48e8f9a0f33bd4167745750cb70040f9d9f1  promtail-windows-amd64.exe.zip)

TASK [ansible-role-promtail : Ensure unzip package is available] ***************
changed: [instance]

TASK [ansible-role-promtail : Create promtail group] ***************************
changed: [instance]

TASK [ansible-role-promtail : Create the promtail user] ************************
changed: [instance]

TASK [ansible-role-promtail : Ensure /usr/local/bin exists] ********************
ok: [instance]

TASK [ansible-role-promtail : Create config directories] ***********************
changed: [instance] => (item=/etc/promtail)
changed: [instance] => (item=/etc/promtail/file_sd)
changed: [instance] => (item=/var/lib/promtail)

TASK [ansible-role-promtail : Create application dirs] *************************
changed: [instance] => (item=/opt/promtail)
changed: [instance] => (item=/opt/promtail/2.3.0)

TASK [ansible-role-promtail : Check promtail binary] ***************************
ok: [instance]

TASK [ansible-role-promtail : Download promtail binaries] **********************
changed: [instance]

TASK [ansible-role-promtail : Unpack promtail binaries] ************************
changed: [instance]

TASK [ansible-role-promtail : Create symlink to latest version] ****************
changed: [instance]

TASK [ansible-role-promtail : Write config] ************************************
changed: [instance]

TASK [ansible-role-promtail : Create systemd service unit] *********************
changed: [instance]

TASK [ansible-role-promtail : Ensure promtail service is started and enabled] ***
changed: [instance]

RUNNING HANDLER [ansible-role-promtail : Restart promtail] *********************
changed: [instance]

PLAY RECAP *********************************************************************
instance                   : ok=20   changed=12   unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

INFO     Running latest > idempotence

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

TASK [Gathering Facts] *********************************************************
ok: [instance]

TASK [ansible-role-promtail : Assert usage of systemd as an init system] *******
ok: [instance] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [ansible-role-promtail : Get latest release] ******************************
ok: [instance]

TASK [ansible-role-promtail : Set promtail version to 2.3.0] *******************
ok: [instance]

TASK [ansible-role-promtail : Get checksum list] *******************************
ok: [instance]

TASK [ansible-role-promtail : Get checksum for amd64 architecture] *************
skipping: [instance] => (item=7a3255f06cd51e09188f5099d4862ac56981af65ade5e4f46b8b9c56eaf3332a  logcli-darwin-amd64.zip)
skipping: [instance] => (item=791274edf8b983f0eb7c9270612439b76dc5860fad468df1158d6dd5c86ecde4  logcli-freebsd-amd64.zip)
skipping: [instance] => (item=af0d748ac29da9f7d43d5e7675996ab331112024fa06d65e82996925f5882658  logcli-linux-amd64.zip)
skipping: [instance] => (item=4197493bff88789a6ad623fedecf5fab0f075c325c4a1c6ca640a0fc068efd21  logcli-linux-arm.zip)
skipping: [instance] => (item=4659f99e10924e4c5e2a4567f80806967c61000cc56ea67ce2b7984c3b8e6e83  logcli-linux-arm64.zip)
skipping: [instance] => (item=8a12bbc138294669bad303c94f65934ceb9c6c3853e46ed248f258c2aeeaa582  logcli-windows-amd64.exe.zip)
skipping: [instance] => (item=042aa01bd242f12b8481e1024f5e3e53169bf14c30937f0b6a568ca8faf0dc24  loki-canary-darwin-amd64.zip)
skipping: [instance] => (item=eb5e5bec76fdff08aeb40815c73f924c4af88720f1d37a727df147ff7aee5c15  loki-canary-freebsd-amd64.zip)
skipping: [instance] => (item=e55569ab6d176ea46680245b20246855deee84c028a7dc1c743b6fb0765341a0  loki-canary-linux-amd64.zip)
skipping: [instance] => (item=5e874da75fa1882d81136d8dd1683930cc50984c1d1fbe83fcd95d4c74e22425  loki-canary-linux-arm.zip)
skipping: [instance] => (item=9b66e23d17115f8306ccb663a5414e7d2f6e47527cab5711468568ad67644831  loki-canary-linux-arm64.zip)
skipping: [instance] => (item=80f23470057c40f01378cdc9d9ac4ef7b35c1590e7860bcc0af32b79bd181b61  loki-canary-windows-amd64.exe.zip)
skipping: [instance] => (item=74e8f05c2dba7c9d67f4234121537485621023d609411ddf9eab4b26af50c349  loki-darwin-amd64.zip)
skipping: [instance] => (item=788b822c7086ee5ea2ead62484f942418c97db22031d708dee03c30933b4463b  loki-freebsd-amd64.zip)
skipping: [instance] => (item=e3cfcdd67fc23f2707eea64b200eada2d8d12864a7052b9482d56fdeae989b3c  loki-linux-amd64.zip)
skipping: [instance] => (item=33d1bcb59e4c2cb94d122476b340f0f85da20dcb05b34a42f766f19bb3529e35  loki-linux-arm.zip)
skipping: [instance] => (item=4ebac8660f2989b3e01fc0eb9334a243be0a87143e192a10ea289f20fbd50b69  loki-linux-arm64.zip)
skipping: [instance] => (item=fa4324458dd133711988d44ceacaeaf6f3d8861a522a400df6c8dfdc1792e89d  loki-windows-amd64.exe.zip)
skipping: [instance] => (item=097fd86317e7922c833a0b2883c5e113a2edcfb23b0c8eabd404f6a76937f6a4  promtail-darwin-amd64.zip)
skipping: [instance] => (item=18895f9f5ef288168451d3cafe39f11199d67619415841d56d28f2b35b4a6f2c  promtail-freebsd-amd64.zip)
ok: [instance] => (item=9ca9f0bf63bec77664d3b62110107d2430c43137943a70713c6f11fa23d48130  promtail-linux-amd64.zip)
skipping: [instance] => (item=c4799ac77875045c959970f332492da2800d6640cd97347d93418b8910783b37  promtail-linux-arm.zip)
skipping: [instance] => (item=e633a378dc88a12138b552c9e3f822b6ae6c2405d5aae11aafd57fa9ed362168  promtail-linux-arm64.zip)
skipping: [instance] => (item=1c5034f3f8e667dd9e7310f7aaeadfea0208690eabd933381adaaadcca758b88  promtail-windows-386.exe.zip)
skipping: [instance] => (item=30b6f1908191e5e6dc68a970a53e48e8f9a0f33bd4167745750cb70040f9d9f1  promtail-windows-amd64.exe.zip)

TASK [ansible-role-promtail : Ensure unzip package is available] ***************
ok: [instance]

TASK [ansible-role-promtail : Create promtail group] ***************************
ok: [instance]

TASK [ansible-role-promtail : Create the promtail user] ************************
ok: [instance]

TASK [ansible-role-promtail : Ensure /usr/local/bin exists] ********************
ok: [instance]

TASK [ansible-role-promtail : Create config directories] ***********************
ok: [instance] => (item=/etc/promtail)
ok: [instance] => (item=/etc/promtail/file_sd)
ok: [instance] => (item=/var/lib/promtail)

TASK [ansible-role-promtail : Create application dirs] *************************
ok: [instance] => (item=/opt/promtail)
ok: [instance] => (item=/opt/promtail/2.3.0)

TASK [ansible-role-promtail : Check promtail binary] ***************************
ok: [instance]

TASK [ansible-role-promtail : Download promtail binaries] **********************
skipping: [instance]

TASK [ansible-role-promtail : Unpack promtail binaries] ************************
skipping: [instance]

TASK [ansible-role-promtail : Create symlink to latest version] ****************
ok: [instance]

TASK [ansible-role-promtail : Write config] ************************************
ok: [instance]

TASK [ansible-role-promtail : Create systemd service unit] *********************
ok: [instance]

TASK [ansible-role-promtail : Ensure promtail service is started and enabled] ***
ok: [instance]

PLAY RECAP *********************************************************************
instance                   : ok=17   changed=0    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0

INFO     Idempotence completed successfully.
INFO     Running latest > side_effect
WARNING  Skipping, side effect playbook not configured.
INFO     Running latest > verify
INFO     Executing Testinfra tests found in /Users/pjahns/projects/private/ansible-role-promtail/molecule/latest/tests/...
============================= test session starts ==============================
platform darwin -- Python 3.9.7, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /Users/pjahns
plugins: testinfra-6.4.0
collected 12 items

molecule/latest/tests/test_latest.py ............                        [100%]

======================== 12 passed in 87.38s (0:01:27) =========================
INFO     Verifier completed successfully.
INFO     Running latest > cleanup
WARNING  Skipping, cleanup playbook not configured.
INFO     Running latest > destroy

PLAY [Destroy] *****************************************************************

TASK [Destroy molecule instance(s)] ********************************************
changed: [localhost] => (item=instance)

TASK [Wait for instance(s) deletion to complete] *******************************
FAILED - RETRYING: Wait for instance(s) deletion to complete (300 retries left).
changed: [localhost] => (item=instance)

TASK [Delete docker networks(s)] ***********************************************

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=2    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0

INFO     Pruning extra files from scenario ephemeral directory
___________________________________________________________________ summary ____________________________________________________________________
  ansible43: commands succeeded
  congratulations :)

Can you double check, that this was not an intermittent failure?
If it was not an intermittent failure, can you please provide more information:

  • what ansible version are you using?
  • what os version are you using? what is the os version of the ansible controller?
  • can you also provide a log with increased verbosity ( -vvvv )

@Lithimlin
Copy link
Contributor Author

I'm using ansible [core 2.11.6] on arch linux. I ran it manually from my system and installed it on a debian 11 host.

I'm not sure if this is because promtail is now already installed, but I now don't have any issues anymore. I'd run it with the explicit version 2.3.0 before to have it installed.

@patrickjahns
Copy link
Owner

I am closing the ticket as I can not reproduce the issue and it seems to be resolved at the reporters side as well. Please feel free to re-open if issues arise again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants