Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% set os_family = salt['grains.get']('os_family') %}
- {% set join_domain = salt['pillar.get']('join-domain:credentials', {}) %}
- {%- if join_domain %}
- {% if os_family == 'Windows' %}
- windows_domain_join:
- module.run:
- - name: system.join_domain
- - domain: {{ join_domain.domain_name }}
- - username: {{ join_domain.username }}
- - password: {{ join_domain.password }}
- - account_ou: {{ join_domain.account_ou }}
- - restart: True
- {% endif %}
- With pillar values to sniff out like:
- join-domain:
- credentials:
- domain_name: 'domain.com'
- username: 'svc_account_domain'
- password: 'thingsandstuff'
- account_ou: 'ou=Servers,dc=domain,dc=com'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement