Skip to content

Commit

Permalink
Create variable for admin group name
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Jul 9, 2024
1 parent c99a269 commit 3b58b46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ansible/legacy-hosts-playbook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
- hosts: all:!no_ssh_users
vars:
admin_group_name: adm
roles:
- ssh_users
4 changes: 2 additions & 2 deletions ansible/roles/ssh_users/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tags: ssh_users
user:
name: "{{ item }}"
group: "admin"
group: "{{ admin_group_name }}"
comment: "{{ ssh_users[item].comment }}"
shell: /bin/bash
state: present
Expand All @@ -25,7 +25,7 @@
path: "/home/{{item}}/.ssh"
state: directory
owner: "{{item}}"
group: "admin"
group: "{{ admin_group_name }}"
mode: 0700
with_items: "{{ admin_usernames }}"

Expand Down
1 change: 1 addition & 0 deletions ansible/roles/ssh_users/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
admin_group_name: admin

0 comments on commit 3b58b46

Please sign in to comment.