Guest User

Untitled

a guest
Nov 9th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. [root@ymlhost-3 ansible-yml]# cat cisco-play.yml
  2. ---
  3. - name: cisco-yml
  4. hosts: cisco
  5. gather_facts: no
  6. connection: local
  7.  
  8. tasks:
  9.  
  10. - name: obtain login credentials
  11. include_vars: secrets.yml
  12.  
  13. - name: define provider
  14. set_fact:
  15. provider:
  16. host: "{{ inventory_hostname }}"
  17. username: "{{ creds['username'] }}"
  18. password: "{{ creds['password'] }}"
  19. auth_pass: "{{ creds['auth_pass'] }}"
  20. authorize: yes
  21.  
  22. - name: Include all .yml
  23. include_vars:
  24. dir: 'tasks'
  25. extensions:
  26. - json
  27. - yml
  28. [root@ymlhost-3 ansible-yml]#
  29.  
  30. [root@ymlhost-3 ansible-yml]# cat cisco-play.yml
  31. ---
  32. - name: cisco-yml
  33. hosts: cisco
  34. gather_facts: no
  35. connection: local
  36.  
  37. tasks:
  38.  
  39. - name: obtain login credentials
  40. include_vars: secrets.yml
  41.  
  42. - name: define provider
  43. set_fact:
  44. provider:
  45. host: "{{ inventory_hostname }}"
  46. username: "{{ creds['username'] }}"
  47. password: "{{ creds['password'] }}"
  48. auth_pass: "{{ creds['auth_pass'] }}"
  49. authorize: yes
  50.  
  51. - name: Include all .yml files except bastion.yml (2.3)
  52. include_vars:
  53. dir: 'vars'
  54. ignore_files: 'bastion.yml'
  55. extensions: ['yml']
  56. [root@ymlhost-3 ansible-yml]#
Add Comment
Please, Sign In to add comment