Skip to content

Commit

Permalink
Merge pull request #7 from rwxd/init
Browse files Browse the repository at this point in the history
fix(defaults): changed users var
  • Loading branch information
rwxd committed Jul 1, 2022
2 parents 3bf87ef + 34c0be0 commit 062b267
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ Inspired from this blog article <https://eengstrom.github.io/musings/generate-no

## Usage

A `users` variable is required e.g.:
A `subid_users` variable is required e.g.:

```yaml
users:
- peter
- james
- name: Set users
set_fact:
subid_users:
- peter
- james

- name: Generate subuids & subgids
include_role:
name: subuid_subgid
```
`/etc/subuid` will contain
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
users: []
subid_users: []
ansible_become: true
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
tasks:
- name: Set users for role
set_fact:
users:
subid_users:
- james
- thorsten
- svc.backup
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
mode: 0644
owner: root
group: root
loop: "{{ users }}"
loop: "{{ subid_users }}"
loop_control:
loop_var: "user"

Expand All @@ -29,6 +29,6 @@
mode: 0644
owner: root
group: root
loop: "{{ users }}"
loop: "{{ subid_users }}"
loop_control:
loop_var: "user"

0 comments on commit 062b267

Please sign in to comment.