Advertisement
Guest User

Untitled

a guest
Feb 28th, 2018
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. {% set os_family = salt['grains.get']('os_family') %}
  2. {% set join_domain = salt['pillar.get']('join-domain:credentials', {}) %}
  3.  
  4. {%- if join_domain %}
  5.  
  6. {% if os_family == 'Windows' %}
  7.  
  8. windows_domain_join:
  9. module.run:
  10. - name: system.join_domain
  11. - domain: {{ join_domain.domain_name }}
  12. - username: {{ join_domain.username }}
  13. - password: {{ join_domain.password }}
  14. - account_ou: {{ join_domain.account_ou }}
  15. - restart: True
  16.  
  17. {% endif %}
  18.  
  19. With pillar values to sniff out like:
  20.  
  21. join-domain:
  22. credentials:
  23. domain_name: 'domain.com'
  24. username: 'svc_account_domain'
  25. password: 'thingsandstuff'
  26. account_ou: 'ou=Servers,dc=domain,dc=com'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement