Skip to content

Commit

Permalink
Add a variable to control how large bitshifts to use
Browse files Browse the repository at this point in the history
  • Loading branch information
sjjamsa authored and Aalto Scientific Computing committed May 22, 2023
1 parent d014b47 commit 75ab464
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
subid_users: []
ansible_become: true
subuid_bitshift: 16
subgid_bitshift: "{{subuid_bitshift}}"
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ansible.builtin.lineinfile:
path: "/etc/subuid"
regexp: "{{ user }}"
line: "{{ user }}:{{ getent_passwd[user].1 | int | bitwise_shift_left(16) }}:65536"
line: "{{ user }}:{{ getent_passwd[user].1 | int | bitwise_shift_left(subuid_bitshift) }}:65536"
backup: true
create: true
mode: 0644
Expand All @@ -23,7 +23,7 @@
ansible.builtin.lineinfile:
path: "/etc/subgid"
regexp: "{{ user }}"
line: "{{ user }}:{{ getent_passwd[user].2 | int | bitwise_shift_left(16) }}:65536"
line: "{{ user }}:{{ getent_passwd[user].2 | int | bitwise_shift_left(subgid_bitshift) }}:65536"
backup: true
create: true
mode: 0644
Expand Down

0 comments on commit 75ab464

Please sign in to comment.