-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Major cleanup of showroom down to 1 var typical deployment * Cleanup of old showroom code
- Loading branch information
Showing
10 changed files
with
104 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
|
||
# Create the showroom user and working directories | ||
|
||
- name: "Create showroom user {{ showroom_user }}" | ||
ansible.builtin.user: | ||
name: "{{ showroom_user | default('showroom') }}" | ||
home: "{{ showroom_user_home_dir }}" | ||
uid: "{{ showroom_user_uid }}" | ||
password: "{{ common_password | password_hash('sha512') }}" | ||
|
||
- name: Setup persistent working directory | ||
ansible.builtin.file: | ||
path: "{{ __showroom_work_dir }}" | ||
state: directory | ||
owner: "{{ showroom_user | default('showroom') }}" | ||
group: "{{ showroom_user_group | default('showroom') }}" | ||
loop: "{{ showroom_work_dirs }}" | ||
loop_control: | ||
loop_var: __showroom_work_dir | ||
|
||
- name: Add passwordless sudo for {{ showroom_user }} | ||
ansible.builtin.lineinfile: | ||
path: /etc/sudoers | ||
regexp: "^{{ showroom_user }}" | ||
line: "{{ showroom_user }} ALL=(ALL) NOPASSWD: ALL" | ||
|
||
- name: User and system configuration when using traefik | ||
when: showroom_frontend_service == "traefik" | ||
block: | ||
|
||
# TODO: Move this to 8443 after validation | ||
# IE eliminate the entire sysctl task once verified and tested | ||
|
||
- name: Allow users to open ports 80 and up without sudo etc | ||
ansible.posix.sysctl: | ||
name: net.ipv4.ip_unprivileged_port_start | ||
value: 80 | ||
state: present | ||
reload: true | ||
|
||
- name: Create acme.json for LetsEncypt called via traefik with correct permissions | ||
ansible.builtin.file: | ||
path: "{{ showroom_user_home_dir }}/orchestration/acme.json" | ||
state: touch | ||
owner: "{{ showroom_user }}" | ||
group: "{{ showroom_user_group }}" | ||
mode: u=rw,g-rwx,o-rwx | ||
|
||
- name: Add ansible_user to group wheel for machinectl privileges | ||
ansible.builtin.user: | ||
name: "{{ ansible_user }}" | ||
groups: wheel | ||
password: "{{ common_password | password_hash('sha512') }}" | ||
append: true | ||
|
||
- name: "Start --user {{ showroom_user }} podman.socket for traefik" | ||
shell: "loginctl enable-linger $USER; systemctl --user enable podman.socket --now" | ||
become: true | ||
become_user: "{{ showroom_user }}" | ||
become_method: community.general.machinectl | ||
vars: | ||
ansible_become_pass: "{{ common_password }}" | ||
environment: | ||
XDG_RUNTIME_DIR: "/run/user/{{ showroom_user_uid }}" | ||
DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/{{ showroom_user_uid }}/bus" | ||
|
||
- name: "Create a Podman network {{ showroom_podman_network }}" | ||
containers.podman.podman_network: | ||
name: "{{ showroom_podman_network | default('showroom_network') }}" | ||
state: present | ||
become_user: "{{ showroom_user }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters