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

Support Ansible 2.9 #1169

Merged
merged 2 commits into from
Apr 6, 2020
Merged

Support Ansible 2.9 #1169

merged 2 commits into from
Apr 6, 2020

Conversation

swalkinshaw
Copy link
Member

No description provided.

@tangrufus
Copy link
Collaborator

tangrufus commented Apr 6, 2020

$ trellis provision production

TASK [wordpress-setup : Warn about deprecated Nginx includes directory] ********
System info:
  Ansible 2.9.6; Darwin
  Trellis version (per changelog): "Support Ansible 2.9"
---------------------------------------------------

The conditional check 'True in nginx_includes_templates.files |
map(attribute='path') | map('search', nginx_includes_deprecated |
regex_escape) | list' failed. The error was: no filter named 'search'

The error appears to be in '/xxx/roles/wordpress-
setup/tasks/nginx-includes.yml': line 13, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Warn about deprecated Nginx includes directory
  ^ here

fatal: [111.222.333.444]: FAILED! => {}
$ trellis exec ansible --version
ansible 2.9.6
  config file = /xxx/trellis/ansible.cfg
  configured module search path = ['/yyy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /xxx/.trellis/virtualenv/lib/python3.7/site-packages/ansible
  executable location = /xxx/.trellis/virtualenv/bin/ansible
  python version = 3.7.7 (default, Mar 10 2020, 15:43:33) [Clang 11.0.0 (clang-1100.0.33.17)]

Works fine on Ansible 2.8.10

$ trellis exec ansible --version
ansible 2.8.10
  config file = /xxx/trellis/ansible.cfg
  configured module search path = ['/yyy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /xxx/.trellis/virtualenv/lib/python3.7/site-packages/ansible
  executable location = /xxx/.trellis/virtualenv/bin/ansible
  python version = 3.7.7 (default, Mar 10 2020, 15:43:33) [Clang 11.0.0 (clang-1100.0.33.17)]

Ansible announcements related to the search filter:

TASK [wordpress-setup : Warn about deprecated Nginx includes directory] ********
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using
`result|search` use `result is search`. This feature will be removed in version
 2.9. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.

See:

when: True in nginx_includes_templates.files | map(attribute='path') | map('search', nginx_includes_deprecated | regex_escape) | list

@tangrufus
Copy link
Collaborator

Also add ansible 2.9 tests on CircleCI, see: #1171

@swalkinshaw
Copy link
Member Author

🤔 that's a tough one to fix since the suggestion won't work here.

One idea is to just remove that deprecation now? It's been 3-4 years 😅

@tangrufus
Copy link
Collaborator

One idea is to just remove that deprecation now? It's been 3-4 years 😅

Agree

@swalkinshaw
Copy link
Member Author

Here it is: #1173

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

Successfully merging this pull request may close these issues.

2 participants