Hi ,

Just letting you check if my plabook is correct below:

I just need your help on our project to Ansible for Cisco ACI module to:

(1)  Create variables to record execution time

(2) Define as the variable the name of the directory where the log is 
stored.

(3)Create a directory on Ansible server to storel logs


---

  -hosts: all    #(1)  Create variables to record execution time

    gather_facts: false

    task:

            -name: create time

             set_fact:

               exe_date: “{{ lookup(‘pipe’,’date+%Y%m%d_%H%M_%S’) }}” 

             run_once: true

 

           -name: create parent directory

            set_fact:

               logdir_date: “{{ inventory_dir }}/log/log_{{ exe_date }}”

            run_once: true

 

 -name: create directory for log

   file:

                path: “{{ logdir_date }}/”

                state: directory

             register: logdir

             delegate_to: localhost              

             run_once: true

 

 

INVENTORY FILE look like this                                     

 

[***]$ tree

 

-ansible.cfg

-doci_inventry.ini

-doci_logget.yml           

-roles

     -get_cli_command

          -task:

             -main.yml.

    -save_cli_command   

         -task:

             -main.yml

    -get_aci_module                   

         -task:

            -main.yml

    -save_aci_module

        -task

           -main.yml

 

 

-files

    -g1_cli.txt

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6085702f-8927-4084-a74d-58b51d80ab7bn%40googlegroups.com.

Reply via email to