Skip to content

tensult/ansible-examples

Repository files navigation

ansible-examples

  • library/test.sh contains a simple test module.
  • In playbook.xml, we are calling this module.
  • To run:
    cd own-module-example
    ansible-playbook playbook.yml
    
    
  • input-set sets fact foo to bar.
  • input-get gets fact foo using debug module.
  • To run:
    cd pass-data-between-roles
    ansible-playbook playbook.yml
    
  • playbook1 sets fact foo to bar.
  • playbook2 gets fact foo using debug module.
  • To run:
    cd pass-data-between-playbooks
    ansible-playbook masterplaybook.yml
    
  • masterplaybook is the main playbook which is used to call a sample role whose output is stored in the variable "output".
  • The sample role echo has a task defined which stores the output of the role into the variable in JSON format.
  • To run:
    cd role-output-in-playbook
    ansible-playbook masterplaybook.yml