diff options
Diffstat (limited to 'roles')
-rw-r--r-- | roles/unix_users/defaults/main.yml | 6 | ||||
-rw-r--r-- | roles/unix_users/subplot.md | 2 | ||||
-rw-r--r-- | roles/unix_users/tasks/main.yml | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/roles/unix_users/defaults/main.yml b/roles/unix_users/defaults/main.yml index ea33fc9..8982001 100644 --- a/roles/unix_users/defaults/main.yml +++ b/roles/unix_users/defaults/main.yml @@ -1,3 +1,9 @@ +# The user of the role MUST define the version they want to use. If +# it's not what the version of unix_users being used actually +# provides, the role will fail. +unix_users_version: null + + # List of system users to create. Value a list of dicts with keys: # # username -- the username of the new user diff --git a/roles/unix_users/subplot.md b/roles/unix_users/subplot.md index 9bd5f6e..f0acf36 100644 --- a/roles/unix_users/subplot.md +++ b/roles/unix_users/subplot.md @@ -17,6 +17,8 @@ and the user foo on host has authorized_keys containing "ssh-rsa" ~~~ ~~~{#foo.yml .file .yaml} +unix_users_version: 0 + unix_users: - username: foo comment: Foo Bar diff --git a/roles/unix_users/tasks/main.yml b/roles/unix_users/tasks/main.yml index 00c49fd..7681632 100644 --- a/roles/unix_users/tasks/main.yml +++ b/roles/unix_users/tasks/main.yml @@ -1,3 +1,8 @@ +- name: "check unix_users_version" + shell: | + [ "{{ unix_users_version }}" = "0" ] || \ + (echo "Unexpected version {{ unix_users_version }}" 1>&2; exit 1) + - name: create system users with_items: "{{ unix_users }}" user: |