Ansible repository with playbooks to manage azure objects
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

43 行
958 B

  1. ---
  2. - name: list ip address
  3. include: list.yml
  4. vars:
  5. ip: "{{ item }}"
  6. when:
  7. - action is defined
  8. - action == 'list'
  9. - (ips | default([], true) | length) > 0
  10. with_items: "{{ ips }}"
  11. - name: In ip address state
  12. include: "{{ item.state | default('present', true) }}.yml"
  13. vars:
  14. ip: "{{ item }}"
  15. when:
  16. - action is undefined
  17. - (ips | default([], true) | length) > 0
  18. with_items: "{{ ips }}"
  19. - name: Update/create ip address
  20. include: present.yml
  21. vars:
  22. ip: "{{ item }}"
  23. when:
  24. - action is defined
  25. - action == 'present'
  26. - item.state is undefined
  27. - (ips | default([], true) | length) > 0
  28. with_items: "{{ ips }}"
  29. - name: Delete ip address
  30. include: absent.yml
  31. vars:
  32. ip: "{{ item }}"
  33. when:
  34. - action is defined
  35. - action == 'absent'
  36. - item.state is undefined
  37. - (ips | default([], true) | length) > 0
  38. with_items: "{{ ips }}"
  39. ...