Skip to content

Instantly share code, notes, and snippets.

@stevenfollis
Last active December 1, 2018 13:23
Show Gist options
  • Save stevenfollis/88c82b71e273b9ebe570b1d7a0cd9e39 to your computer and use it in GitHub Desktop.
Save stevenfollis/88c82b71e273b9ebe570b1d7a0cd9e39 to your computer and use it in GitHub Desktop.
Docker Compose files to distribute and delete gMSA Cred Spec files across a Swarm Cluster
# Distribute a Credential Spec file to all Windows Server cluster nodes
# gmsa.json by default, else set $env:CREDSPEC with filename
version: '3.3'
configs:
credspec:
file: ${ProgramData}/Docker/CredentialSpecs/${CREDSPEC:-gmsa.json}
services:
copy:
command: cmd /c copy credspec C:\\out\\${CREDSPEC:-gmsa.json}
configs:
- credspec
deploy:
mode: global
restart_policy:
condition: none
placement:
constraints:
- node.platform.os == windows
image: microsoft/nanoserver
volumes:
- source: ${ProgramData}/Docker/CredentialSpecs
target: C:\out
type: bind
# Delete a Credential Spec file from all Windows Server cluster nodes
# gmsa.json by default, else set $env:CREDSPEC with filename
version: '3.3'
services:
copy:
command: cmd /c del C:\\out\\${CREDSPEC:-gmsa.json}
deploy:
mode: global
restart_policy:
condition: none
placement:
constraints:
- node.platform.os == windows
image: microsoft/nanoserver
volumes:
- source: ${ProgramData}/Docker/CredentialSpecs
target: C:\out
type: bind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment