Dev to main #1
@@ -1,3 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
ansible_become_passwd: "{{ ansible_password }}"
|
ansible_become_passwd: "{{ ansible_password }}"
|
||||||
|
human_admin_user: max
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
- name: Create a new user with a password, set shell
|
- name: Create a new user with a password, set shell
|
||||||
remote_user: ansible
|
remote_user: ansible
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: max
|
name: "{{ human_admin_user }}"
|
||||||
groups: sshusers,sudo
|
groups: sshusers,sudo
|
||||||
password: "{{ user_passwd_hash }}"
|
password: "{{ user_passwd_hash }}"
|
||||||
shell: /bin/zsh
|
shell: /bin/zsh
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
- name: Set authorized key taken from file
|
- name: Set authorized key taken from file
|
||||||
remote_user: ansible
|
remote_user: ansible
|
||||||
ansible.posix.authorized_key:
|
ansible.posix.authorized_key:
|
||||||
user: max
|
user: "{{ human_admin_user }}"
|
||||||
state: present
|
state: present
|
||||||
key: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/ansible_key.pub') }}"
|
key: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/ansible_key.pub') }}"
|
||||||
|
|
||||||
@@ -18,15 +18,15 @@
|
|||||||
remote_user: ansible
|
remote_user: ansible
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/install_omz.sh"
|
src: "{{ role_path }}/files/install_omz.sh"
|
||||||
dest: /home/max/install_omz.sh
|
dest: "/home/{{ human_admin_user }}/install_omz.sh"
|
||||||
owner: max
|
owner: "{{ human_admin_user }}"
|
||||||
group: max
|
group: "{{ human_admin_user }}"
|
||||||
mode: u=rwx,g=r,o-rwx
|
mode: u=rwx,g=r,o-rwx
|
||||||
|
|
||||||
# WARNING: UNPRIVILEGED USER (not ansible) COMMANDS
|
# WARNING: UNPRIVILEGED USER (not ansible) COMMANDS
|
||||||
- name: Install oh my zsh
|
- name: Install oh my zsh
|
||||||
remote_user: max
|
remote_user: "{{ human_admin_user }}"
|
||||||
ansible.builtin.command: /home/max/install_omz.sh
|
ansible.builtin.command: "/home/{{ human_admin_user }}/install_omz.sh"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
vars:
|
vars:
|
||||||
|
|
||||||
@@ -34,18 +34,18 @@
|
|||||||
remote_user: ansible
|
remote_user: ansible
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/.zshrc"
|
src: "{{ role_path }}/files/.zshrc"
|
||||||
dest: /home/max/.zshrc
|
dest: "/home/{{ human_admin_user }}/.zshrc"
|
||||||
owner: max
|
owner: "{{ human_admin_user }}"
|
||||||
group: max
|
group: "{{ human_admin_user }}"
|
||||||
mode: u=rw,g=r,o-rwx
|
mode: u=rw,g=r,o-rwx
|
||||||
|
|
||||||
- name: Configure vim, by pushing the config
|
- name: Configure vim, by pushing the config
|
||||||
remote_user: ansible
|
remote_user: ansible
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/.vimrc"
|
src: "{{ role_path }}/files/.vimrc"
|
||||||
dest: /home/max/.vimrc
|
dest: "/home/{{ human_admin_user }}/.vimrc"
|
||||||
owner: max
|
owner: "{{ human_admin_user }}"
|
||||||
group: max
|
group: "{{ human_admin_user }}"
|
||||||
mode: u=rw,g=r,o-rwx
|
mode: u=rw,g=r,o-rwx
|
||||||
|
|
||||||
|
|
||||||
@@ -54,13 +54,13 @@
|
|||||||
- name: Set authorized key taken from file
|
- name: Set authorized key taken from file
|
||||||
remote_user: ansible
|
remote_user: ansible
|
||||||
ansible.posix.authorized_key:
|
ansible.posix.authorized_key:
|
||||||
user: max
|
user: "{{ human_admin_user }}"
|
||||||
state: absent
|
state: absent
|
||||||
key: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/ansible_key.pub') }}"
|
key: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/ansible_key.pub') }}"
|
||||||
|
|
||||||
- name: Set authorized key taken from file
|
- name: Set authorized key taken from file
|
||||||
remote_user: ansible
|
remote_user: ansible
|
||||||
ansible.posix.authorized_key:
|
ansible.posix.authorized_key:
|
||||||
user: max
|
user: "{{ human_admin_user }}"
|
||||||
state: present
|
state: present
|
||||||
key: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/max_regular_key.pub') }}"
|
key: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/max_regular_key.pub') }}"
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
- name: Clear old Neovim config
|
- name: Clear old Neovim config
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: absent
|
state: absent
|
||||||
path: /home/max/.config/nvim
|
path: "/home/{{ human_admin_user }}/.config/nvim"
|
||||||
|
|
||||||
- name: Configure neovim, by pushing the config
|
- name: Configure neovim, by pushing the config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/nvim_config/"
|
src: "{{ role_path }}/files/nvim_config/"
|
||||||
dest: /home/max/.config/nvim
|
dest: "/home/{{ human_admin_user }}/.config/nvim"
|
||||||
owner: max
|
owner: "{{ human_admin_user }}"
|
||||||
group: max
|
group: "{{ human_admin_user }}"
|
||||||
mode: u=rw,g=r,o-rwx
|
mode: u=rw,g=r,o-rwx
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
- name: Configure oh my zsh, by pushing the config file
|
- name: Configure oh my zsh, by pushing the config file
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/.zshrc"
|
src: "{{ role_path }}/files/.zshrc"
|
||||||
dest: /home/max/.zshrc
|
dest: "/home/{{ human_admin_user }}/.zshrc"
|
||||||
owner: max
|
owner: "{{ human_admin_user }}"
|
||||||
group: max
|
group: "{{ human_admin_user }}"
|
||||||
mode: u=rw,g=r,o-rwx
|
mode: u=rw,g=r,o-rwx
|
||||||
|
|||||||
@@ -3,20 +3,20 @@
|
|||||||
- name: Clear old config
|
- name: Clear old config
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: absent
|
state: absent
|
||||||
path: /home/max/.config/ranger
|
path: "/home/{{ human_admin_user }}/.config/ranger"
|
||||||
|
|
||||||
- name: Configure ranger, by pushing the config
|
- name: Configure ranger, by pushing the config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/ranger_config/"
|
src: "{{ role_path }}/files/ranger_config/"
|
||||||
dest: /home/max/.config/ranger
|
dest: "/home/{{ human_admin_user }}/.config/ranger"
|
||||||
owner: max
|
owner: "{{ human_admin_user }}"
|
||||||
group: max
|
group: "{{ human_admin_user }}"
|
||||||
mode: u=rw,g=r,o-rwx
|
mode: u=rw,g=r,o-rwx
|
||||||
|
|
||||||
- name: Make sure ~/.config/ranger/scope.sh is executable
|
- name: Make sure ~/.config/ranger/scope.sh is executable
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /home/max/.config/ranger/scope.sh
|
path: "/home/{{ human_admin_user }}/.config/ranger/scope.sh"
|
||||||
owner: max
|
owner: "{{ human_admin_user }}"
|
||||||
group: max
|
group: "{{ human_admin_user }}"
|
||||||
mode: u=rwx,g=rx,o-rwx
|
mode: u=rwx,g=rx,o-rwx
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
- name: Configure vim, by pushing the config
|
- name: Configure vim, by pushing the config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/.vimrc"
|
src: "{{ role_path }}/files/.vimrc"
|
||||||
dest: /home/max/.vimrc
|
dest: "/home/{{ human_admin_user }}/.vimrc"
|
||||||
owner: max
|
owner: "{{ human_admin_user }}"
|
||||||
group: max
|
group: "{{ human_admin_user }}"
|
||||||
mode: u=rw,g=r,o-rwx
|
mode: u=rw,g=r,o-rwx
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user