Skip to content

Instantly share code, notes, and snippets.

@eliasp
Created March 14, 2015 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliasp/95b12809d19e9cdc0b07 to your computer and use it in GitHub Desktop.
Save eliasp/95b12809d19e9cdc0b07 to your computer and use it in GitHub Desktop.
Join a domain…
{% from "domain/map.jinja" import domain with context %}
{% set ticket_available = "false" %}
{% if salt['cmd.retcode']('klist') == '0' %}
{% set ticket_available = "true" %}
{% endif %}
{% if ticket_available == "true" %}
domain-join-linux-realmd:
cmd.run:
- name: 'realm join {{ domain.data.domain }} --computer-ou="{{ domain.data.computer_ou }}"'
{% else %}
please-run-kinit:
test.configurable_test_state:
- name: No Kerberos ticket available
- comment: "Please run 'kinit your_user@{{ domain.data.domain|upper }}' to get a Kerberos ticket"
- changes: False
- result: False
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment