Skip to content

Update Ansible to 2.9.2 version #1142

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

Closed
php-coder opened this issue Oct 22, 2019 · 9 comments
Closed

Update Ansible to 2.9.2 version #1142

php-coder opened this issue Oct 22, 2019 · 9 comments
Assignees
Labels
ADR/needed A decision has been made and it needs to be documented area/build scripts kind/dependency-update Update one of dependencies techdebt
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Oct 22, 2019

The pinned and outdated version of Ansible brought too much headaches and it seems it's easier to update Ansible rather than continue to put more workarounds.

Also my initial assumption was that it's a regression and but it's turned out that it was actually a fix for buggy behaviour that we use: ansible/ansible#29618

History:

@asm0dey JFYI

@php-coder php-coder added this to the 0.4.2 milestone Oct 22, 2019
@php-coder php-coder self-assigned this Oct 22, 2019
@php-coder
Copy link
Owner Author

P.S. And now it also conflicts with ansible-lint (see #1129) as it pulls the latest version of Ansible.

@php-coder
Copy link
Owner Author

One more point: in order to use systemd module (#998) we need Ansible 2.2+

@php-coder php-coder added the kind/dependency-update Update one of dependencies label Nov 6, 2019
php-coder added a commit that referenced this issue Nov 10, 2019
…rent dir.

This change makes deployment work on Ansible >2.1.10

See also related issue: ansible/ansible#29618

Prerequisite for #1142
php-coder added a commit that referenced this issue Nov 12, 2019
…book.

This change makes deployment work on Ansible of the older (>=2.1.10) and newer versions.

Correction for 1bf3966 commit.

Prerequisite for #1142
@php-coder php-coder changed the title Unpin Ansible and update to the latest version Update Ansible to the latest version Nov 12, 2019
@php-coder
Copy link
Owner Author

php-coder commented Nov 12, 2019

I think that we shouldn't unpin but just update to the latest version. Having a fixed version is good for stable builds.

@php-coder
Copy link
Owner Author

New warnings after update to 2.2.30:

TASK [Stopping service] ********************************************************
 [WARNING]: raw module does not support the environment keyword
changed: [my-stamps.ru]

TASK [Copying WAR file] ********************************************************
changed: [my-stamps.ru]

TASK [Starting service] ********************************************************
 [WARNING]: raw module does not support the environment keyword
changed: [my-stamps.ru]

This was a bug (see ansible/ansible#23764) that has been fixed in newer versions.

@php-coder
Copy link
Owner Author

php-coder commented Nov 14, 2019

TASK [Ensuring that WAR file exists] *******************************************
ok: [my-stamps.ru -> 127.0.0.1] => {
    "changed": false, 
    "msg": "All assertions passed"
}

It seems like we should try quiet parameter to make the output cleaner.

@php-coder
Copy link
Owner Author

Warning on 2.9.0 when I run ansible-playbook provisioning/prod.yml -i provisioning/prod.inventory --tags backup:

TASK [mystamps-backup : Creating /data/backups] ************************************************************************************************************************************************************
[DEPRECATION WARNING]: Distribution Ubuntu 16.04 on host my-stamps.ru should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible
release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. This feature
will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [my-stamps.ru]

and

TASK [mystamps-backup : Installing duplicity] **************************************************************************************************************************************************************
[WARNING]: Could not find aptitude. Using apt-get instead

php-coder added a commit that referenced this issue Nov 29, 2019
Additional changes have been made:

1) remove get_md5 parameter from stat module.  From
   https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.5.html#noteworthy-module-changes
   %
   The stat and win_stat modules have changed the default of the option get_md5 from true to false.
   This option will be removed starting with Ansible version 2.9
   %

2) rewrite the way we pass variables to roles. Use "vars" parameter for for that.  Inspired by
   https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.5.html#fixed-handling-of-keywords-and-inline-variables

3) migrate "with_items" to "loop" as this is "the recommended way to perform loops". Details:
   https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.5.html#migrating-from-with-x-to-loop

Changelogs:
- https://github.com/ansible/ansible/blob/stable-2.5/changelogs/CHANGELOG-v2.5.rst
- https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.5.html

Part of #1142
php-coder added a commit that referenced this issue Dec 18, 2019
The error was:
ERROR! 'quiet' is not a valid attribute for a Task

Correction for ab8be0b commit.

Address to #1142
@php-coder
Copy link
Owner Author

It seems like we should try quiet parameter to make the output cleaner.

Done.

New warning after updating to 2.8.x:

TASK [Stopping monitoring] *****************************************************
[DEPRECATION WARNING]: Distribution Ubuntu 16.04 on host my-stamps.ru should
use /usr/bin/python3, but is using /usr/bin/python for backward compatibility
with prior Ansible releases. A future Ansible release will default to using the
discovered platform python for this host. See https://docs.ansible.com/ansible
/2.8/reference_appendices/interpreter_discovery.html for more information. This
feature will be removed in version 2.12. Deprecation warnings can be disabled
by setting deprecation_warnings=False in ansible.cfg.
ok: [my-stamps.ru]

See https://travis-ci.org/php-coder/mystamps/jobs/626895186

@php-coder php-coder changed the title Update Ansible to the latest version Update Ansible to 2.9.2 version Dec 28, 2019
@php-coder
Copy link
Owner Author

New warning after updating to 2.8.x:

I'll create an issue for that.

@php-coder
Copy link
Owner Author

Finally fixed in 1ebedcd commit.

/spent 9h36m

@php-coder php-coder unpinned this issue Dec 28, 2019
@php-coder php-coder added the ADR/needed A decision has been made and it needs to be documented label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADR/needed A decision has been made and it needs to be documented area/build scripts kind/dependency-update Update one of dependencies techdebt
Projects
None yet
Development

No branches or pull requests

1 participant