Didn't see anything mentioned in changes notes for 1.9 about changing the way sudo worked with includes, so wanted to post this:
In the below example, sudo is no longer seeming to apply to the tasks in the included file . If I attach "sudo: True" directly to the task then the playbook runs, see second example.
First example works fine in 1.8.4, but 1.9.0.1 the playbooks/roles break:
TASK: [sts-base-system | apt packages | update cache] *************************
failed: [10.0.50.50] => {"failed": true}
msg: Failed to lock apt for exclusive operation
FATAL: all hosts have already failed -- aborting
Can workaround by updating all playbooks and roles to apply sudo directly to each task, but pretty inconvenient.
main.yml
---
- { include: packages.yml, sudo: True, tags: ['packages'] }
packages.yml (1)
---
- name: apt packages | update cache
apt:
update_cache: True
cache_valid_time: 600
packages.yml (2)
---
- name: apt packages | update cache
sudo: True
apt:
update_cache: True
cache_valid_time: 600