Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
DING! That worked. Thank you so much! On Friday, May 20, 2016 at 11:56:12 AM UTC-5, Brian Coca wrote: > > you are mixing notations > > {{ hostvars['server1']['timestamp']['stdout'] }} > > > -- > Brian Coca > -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
When I do this: {{ hostvars['server1']['timestamp.stdout'] }} as in: - name: "Backup {{ proddbname }} Database" mysql_db: "state=dump name={{ proddbname }} target={{ homedir }}{{ proddbname }}{{ hostvars['server01']['timestamp.stdout'] }}.sql.gz" It gives me the error fatal:

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
So in order to access this var/register from server01, I could do something like in playbook-01.yml: --- - hosts: "{{ hostvars['server01']['proddbhost'] }}" (When I do that I get "ERROR! 'hostvars' is undefined" On Friday, May 20, 2016 at 8:30:48 AM UTC-5, Brian Coca wrote: > > vars don't

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
--- - hosts: server01 remote_user: jlouthan vars: proddbhost: proddb01 tasks: - name: Get current timestamp local_action: command bash -c 'date +%Y-%m-%d.%H%M' register: timestamp run_once: true - name: Get current datestamp

Re: [ansible-project] Vars and register passing on to include playbooks

2016-05-20 Thread Joe Louthan
indented var: that is a copy/paste mistake. So those vars and register will not persist to any of the other include playbooks? On Friday, May 20, 2016 at 7:49:18 AM UTC-5, Brian Coca wrote: > > So vars seems to be incorrectly indented, also you should not need to add > 'bash' to command > >

[ansible-project] Vars and register passing on to include playbooks

2016-05-19 Thread Joe Louthan
By all accounts that I can see, the following should work: --- - hosts: server01 remote_user: jlouthan vars: proddbhost: proddb01 tasks: - name: Get current timestamp local_action: command bash -c 'date +%Y-%m-%d.%H%M' register: timestamp run_once: true -

[ansible-project] synchronize between two remote servers: you can pull but you cannot push?

2016-05-02 Thread Joe Louthan
So pulling in synchronize between two remote servers works like a champ: --- - hosts: web14 remote_user: jlouthan tasks: - name: Get current timestamp local_action: command bash -c 'date +%Y-%m-%d.%H%M' register: timestamp run_once: true - name: Get current

Re: [ansible-project] Utilizing timestamps within filenames

2016-04-25 Thread Joe Louthan
That's it! Thank you! To avoid being "that guy", here is the working playbook: --- - hosts: dbserver remote_user: jlouthan tasks: - name: Get current timestamp local_action: command bash -c 'date +%Y-%m-%d.%H%M' # Consider switch this to a shell module with date command

Re: [ansible-project] Utilizing timestamps within filenames

2016-04-22 Thread Joe Louthan
M" > register: now > run_once: true > > (or something similar adapted to your local environment) before your > dump task and then use {{ now }} in the next tasks to always get the > same timestamp. > > Best, > Felix > > > > On Thu, 21 Apr 2016 08: