Compare commits
4 Commits
33f7b59251
...
mydev
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c58518e77 | |||
| 1551565825 | |||
| 3dec85c5a8 | |||
| 1cd309c151 |
@@ -7,7 +7,6 @@ allow_world_readable_tmpfiles: true
|
||||
|
||||
|
||||
ansible_user_id: root
|
||||
interactive_user:
|
||||
interactive_home:
|
||||
interactive_password:
|
||||
|
||||
interactive_user: "{{ remote_user | default('ansible') }}"
|
||||
interactive_home: "/home/{{ interactive_user}}"
|
||||
interactive_password: "{{ test_password }}"
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
# - name: Make /tmp non-executable
|
||||
# ansible.builtin.import_tasks: tmp-nonexec.yml
|
||||
|
||||
# not sure if needed, but I'll leave it here as a reference if needed.
|
||||
# - name: Import tasks to ensure creation of unprivileged user
|
||||
# ansible.builtin.import_tasks: unpriv-user.yml
|
||||
- name: Import tasks to ensure creation of unprivileged user
|
||||
ansible.builtin.import_tasks: unpriv-user.yml
|
||||
|
||||
- name: Import custom fact setting
|
||||
ansible.builtin.import_tasks: custom-fact.yml
|
||||
@@ -28,9 +27,8 @@
|
||||
# - name: Import firmware tasks
|
||||
# ansible.builtin.import_tasks: additional-firmware.yml
|
||||
|
||||
# not sure if needed, but I'll leave it here as a reference if needed.
|
||||
# - name: Import color-shell tasks for the common-role
|
||||
# ansible.builtin.import_tasks: color-shell.yml
|
||||
- name: Import color-shell tasks for the common-role
|
||||
ansible.builtin.import_tasks: color-shell.yml
|
||||
|
||||
- name: Import journald tasks for the common-role
|
||||
ansible.builtin.import_tasks: edit-journald.yml
|
||||
|
||||
@@ -10,28 +10,28 @@
|
||||
skeleton: /etc/skel
|
||||
append: true
|
||||
|
||||
- name: Check the primary key for the unprivileged user
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ interactive_user }}"
|
||||
key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-1.pub') }}"
|
||||
state: present
|
||||
exclusive: false
|
||||
register: setkey
|
||||
# - name: Check the primary key for the unprivileged user
|
||||
# ansible.posix.authorized_key:
|
||||
# user: "{{ interactive_user }}"
|
||||
# key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-1.pub') }}"
|
||||
# state: present
|
||||
# exclusive: false
|
||||
# register: setkey
|
||||
|
||||
- name: Re-set the primary key as exclusive, if we found that the key was not present yet # noqa: no-handler
|
||||
when: setkey.changed
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ interactive_user }}"
|
||||
key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-1.pub') }}"
|
||||
state: present
|
||||
exclusive: true
|
||||
# - name: Re-set the primary key as exclusive, if we found that the key was not present yet # noqa: no-handler
|
||||
# when: setkey.changed
|
||||
# ansible.posix.authorized_key:
|
||||
# user: "{{ interactive_user }}"
|
||||
# key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-1.pub') }}"
|
||||
# state: present
|
||||
# exclusive: true
|
||||
|
||||
- name: Set the secondary key for the unprivileged user
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ interactive_user }}"
|
||||
key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-2.pub') }}"
|
||||
state: present
|
||||
exclusive: false
|
||||
# - name: Set the secondary key for the unprivileged user
|
||||
# ansible.posix.authorized_key:
|
||||
# user: "{{ interactive_user }}"
|
||||
# key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-2.pub') }}"
|
||||
# state: present
|
||||
# exclusive: false
|
||||
|
||||
- name: Install required package to become unprivileged users
|
||||
ansible.builtin.apt:
|
||||
|
||||
Reference in New Issue
Block a user