Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. hosts.ini
  2. [group]
  3. dbclient.example.com ip=x.x.x.x
  4. db.example.com ip=y.y.y.y
  5.  
  6.  
  7. group_vars/group.yml
  8. ansible_host: "{{ip}}"
  9.  
  10.  
  11. playbook.yml
  12. hosts: dbclient.example.com
  13. tasks:
  14. - name: 'Test hostname'
  15. command: 'hostname'
  16. delegate_to: db.example.com
  17.  
  18.  
  19. expected output
  20. changed: [dbclient.example.com -> db.example.com] => {
  21. "changed": true,
  22. ...
  23. "stdout": "db.example.com"
  24. }
  25.  
  26. actual output
  27. changed: [dbclient.example.com -> {{ip}}] => {
  28. "changed": true,
  29. ...
  30. "stdout": "dbclient.example.com"
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement