PJ1
(PJ)
March 21, 2013, 2:58pm
1
Hi,
I’m trying to include a subset of OS tasks in another task file, which in turn is included in the main book, ie.
playbook.yml
→ include: tasks/os_common.yml
→ include: sysctl.yml
os_common.yml contains a bunch of normal tasks in addition to the include:
Can you please post these files on gist.github.com so we can see them
with formatting?
Please also include the command you are using to run things in the gist.
Thanks!
PJ1
(PJ)
March 21, 2013, 3:35pm
3
PJ1
(PJ)
March 21, 2013, 3:40pm
4
If I skip os_common.yml, i.e. specify sysctl.yml as include file in main.yml it works just fine…
PJ, I believe your sysctl.yml task include needs the action attribute:
lineinfile: dest=/etc/sysctl.conf regexp=^kernel.core_pattern line="kernel.core_pattern = /var/cores/core_%h_%e.%p"
becomes …
action: lineinfile dest=/etc/sysctl.conf regexp=^kernel.core_pattern line="kernel.core_pattern = /var/cores/core_%h_%e.%p"
PJ1
(PJ)
March 21, 2013, 6:14pm
6
Indeed, thanks for spotting it.
That would still imply that shorthands doesn’t work in that structure and that it’s also unable to pick up the task name when producing the error message.
PJ1
(PJ)
March 22, 2013, 9:50am
7
Is this something that I should create a ticket on perhaps?
Might be a good idea, at the least we can spawn a document ticket from it to make sure its very clear in the documentation.
PJ1
(PJ)
March 22, 2013, 10:48am
9
I revert that… tried to set it up again and failed to reproduce the successful run (maybe I managed to fiddle with the wrong playbook yesterday).
I still get ‘ERROR: ‘action’ or ‘local_action’ attribute missing in task “”’
Did some initial debugging it seems it expects action/local_action in the os_common.yml and don’t even read sysctl.yml before exiting.
PJ1
(PJ)
March 22, 2013, 11:11am
10
Tested on the devel branch and there it works fine… I was running my initial tests on 0.9.
case closed.