Skip to content

Instantly share code, notes, and snippets.

@toastedpenguin
Last active November 16, 2015 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save toastedpenguin/c76513c4d6aa24cd90c3 to your computer and use it in GitHub Desktop.
Save toastedpenguin/c76513c4d6aa24cd90c3 to your computer and use it in GitHub Desktop.
{% set target = 'saltwebtest23' %}
rename_system:
salt.state:
- tgt: {{ target }}
- sls: wintools.rename
reboot1:
salt.function:
- name: system.reboot
- tgt: {{ target }}
- require:
- salt: rename_system
wait_for_reboots1:
salt.wait_for_event:
- name: salt/minion/*/start
- id_list:
- {{ target }}
- require:
- salt: reboot1
join_domain:
salt.state:
- tgt: {{ target }}
- sls: wintools.domain
- require:
- salt: wait_for_reboots1
reboot2:
salt.function:
- name: system.reboot
- tgt: {{ target }}
- require:
- salt: join_domain
wait_for_reboots2:
salt.wait_for_event:
- name: salt/minion/*/start
- id_list:
- {{ target }}
- require:
- salt: reboot2
remove_local_saltaccount:
salt.state:
- tgt: {{ target }}
- sls: winusers.rm_salt
- require:
- salt: wait_for_reboots2
timezone:
salt.function:
- name: timezone.set_zone
- tgt: {{ target }}
- arg:
- timezone='America/New_York'
- require:
- salt: remove_local_saltaccount
refresh_win_pkg_db:
salt.function:
- name: pkg.refresh_db
- tgt: {{ target }}
- require:
- salt: timezone
install_win_updates:
salt.function:
- name: win_update.install_updates
- tgt: {{ target }}
- timeout: 600
- arg:
- categories="['Updates', 'Critical Updates', 'Security Updates']"
reboot3:
salt.function:
- name: system.reboot
- tgt: {{ target }}
- require:
- salt: install_win_updates
wait_for_reboots3:
salt.wait_for_event:
- name: salt/minion/*/start
- id_list:
- {{ target }}
- require:
- salt: reboot3
install_webappl:
salt.state:
- tgt: {{ target }}
- sls: winroles.webserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment