Start podman restart service in user role
This commit is contained in:
parent
16c78c0d00
commit
b1ff2515e1
4 changed files with 13 additions and 16 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
vars:
|
vars:
|
||||||
user_username: "{{ actual_username }}"
|
user_username: "{{ actual_username }}"
|
||||||
user_password: "{{ actual_password }}"
|
user_password: "{{ actual_password }}"
|
||||||
|
user_use_podman_restart: true
|
||||||
- name: Create a directory for holding actual's (volume) data
|
- name: Create a directory for holding actual's (volume) data
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ actual_username }}"
|
become_user: "{{ actual_username }}"
|
||||||
|
|
@ -12,14 +13,6 @@
|
||||||
path: "/home/{{ actual_username }}/actual_data"
|
path: "/home/{{ actual_username }}/actual_data"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0700'
|
mode: '0700'
|
||||||
- name: Start the podman-restart.service
|
|
||||||
become: true
|
|
||||||
become_user: "{{ actual_username }}"
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: podman-restart.service
|
|
||||||
state: started
|
|
||||||
enabled: true
|
|
||||||
scope: user
|
|
||||||
- name: Gather facts on the actual container
|
- name: Gather facts on the actual container
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ actual_username }}"
|
become_user: "{{ actual_username }}"
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
vars:
|
vars:
|
||||||
user_username: "{{ pi_hole_username }}"
|
user_username: "{{ pi_hole_username }}"
|
||||||
user_password: "{{ pi_hole_password }}"
|
user_password: "{{ pi_hole_password }}"
|
||||||
|
user_use_podman_restart: true
|
||||||
- name: Create the /etc-pihole directory in the home directory (will be mounted to the container)
|
- name: Create the /etc-pihole directory in the home directory (will be mounted to the container)
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ pi_hole_username }}"
|
become_user: "{{ pi_hole_username }}"
|
||||||
|
|
@ -34,14 +35,6 @@
|
||||||
# changes the user of the folder to a UID only known within the container. This command basically doesn't need to
|
# changes the user of the folder to a UID only known within the container. This command basically doesn't need to
|
||||||
# change anything at this point so we'll ignore the error for now.
|
# change anything at this point so we'll ignore the error for now.
|
||||||
- "'set_mode_if_different' not in command_result.module_stdout"
|
- "'set_mode_if_different' not in command_result.module_stdout"
|
||||||
- name: Start the podman-restart.service
|
|
||||||
become: true
|
|
||||||
become_user: "{{ pi_hole_username }}"
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: podman-restart.service
|
|
||||||
state: started
|
|
||||||
enabled: true
|
|
||||||
scope: user
|
|
||||||
- name: Gather facts on the pi-hole container
|
- name: Gather facts on the pi-hole container
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ pi_hole_username }}"
|
become_user: "{{ pi_hole_username }}"
|
||||||
|
|
|
||||||
|
|
@ -115,3 +115,12 @@
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ target_user }}"
|
name: "{{ target_user }}"
|
||||||
shell: /usr/bin/zsh
|
shell: /usr/bin/zsh
|
||||||
|
- name: Start the podman-restart.service
|
||||||
|
become: true
|
||||||
|
become_user: "{{ target_user }}"
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: podman-restart.service
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
scope: user
|
||||||
|
when: user_use_podman_restart
|
||||||
|
|
|
||||||
2
roles/user/vars/main/defaults.yml
Normal file
2
roles/user/vars/main/defaults.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
user_use_podman_restart: false
|
||||||
Loading…
Add table
Add a link
Reference in a new issue