reusing playbooks

Hi,
I have been checking the documentation and some of the list, for this answer.

My current layout if like this

svn/
CitrusLeaf/
CL200/

files/

tasks/

templates/

vars/

CL400/

files/

tasks/

templates/

vars/

StreamingCluster/

SC200/

files/

tasks/

templates/

vars/

SC400/

files/

tasks/

templates/

vars/

WebServers/

WS200/

files/

tasks/

templates/

vars/

WS400/

files/

tasks/

templates/

vars/

global/

files/

tasks/

templates/

vars/

global_vars.yml
hosts

Is my understanding correct?, that if I’m running a play from CitrusLeaf/CL200/tasks that I cannot call a playbook in global/tasks?

I want to keep all my user, and standard config tasks like SSH banners in the global tasks directory because those things should be consistent on all machines.

Thanks,
James

Is my understanding correct?, that if I'm running a play from
CitrusLeaf/CL200/tasks that I cannot call a playbook in global/tasks?

It all assumes paths are relative to the first playbook you execute,
so "../" and such works fine.

I generally expected to see things tagged versus executing specific
sub playbook files by name, so you'd seldom be launching a sub
playbook.

(Other people do though)

--Michael

All works as long as you keep paths relative

I’m not clear what is required to make this work, or if I need to use variables to deal with this issue? Do I have to use “hosts:, user:,” etc to get the NTP.yml to work?

Thanks,
James

sheepchase:tasks jmarcus$ ansible-playbook Testing.yml -k
SSH password:
ERROR: parse error: playbooks must be formatted as a YAML list
sheepchase:tasks jmarcus$ head Testing.yml

  • hosts: 172.16.145.134
    user: root
    sudo: False
    gather_facts: True
  • include: NTP.yml

tasks:

Install other preqs

sheepchase:tasks jmarcus$ head -20 Testing.yml

  • hosts: 172.16.145.134
    user: root
    sudo: False
    gather_facts: True
  • include: NTP.yml

tasks:

Install other preqs

  • name: Make sure make has the lastest version installed
    action: yum name=make state=latest
    tags:

  • InstallPrereqs

  • name: Make sure openssl-devel the lastest version installed
    action: yum name=openssl-devel state=latest
    tags:

  • InstallPrereqs

sheepchase:tasks jmarcus$ cat NTP.yml
#- hosts: 172.16.145.134

user: root

sudo: False

gather_facts: True

tasks:

  • name: Make sure NTP has the lastest version installed
    action: yum name=ntp state=latest
    tags:

  • NTP

  • name: Run a manual NTP udpate
    action: command /usr/sbin/ntpdate -s -b -p 8 -u 0.centos.pool.ntp.org
    tags:

  • NTP

  • name: Make sure NTP is started
    action: service name=ntpd state=started
    tags:

  • NTP

  • name: Make sure NTP is enabled on boot
    action: service name=ntpd enabled=yes
    tags:

  • NTP

  • name: Make sure TIMEZONE is set
    action: command cp -f /usr/share/zoneinfo/America/New_York /etc/localtime
    tags:

  • NTP

can't really tell from email, pastebin better, but I think your yaml
file tabbing is incorrect.

I guess my question is when calling a playbook do, in this case NTP.yml do I need any of these?

  • hosts:
    user:
    sudo:
    gather_facts:
    tasks: