Match naming to ordering

This commit is contained in:
Wojciech Kozlowski 2022-12-13 00:19:39 +01:00
parent 2a694ac6ed
commit 6574b1c86b
33 changed files with 122 additions and 104 deletions

View File

@ -1,19 +0,0 @@
- name: "play:services : role:setup_system : tasks:podman"
ansible.builtin.import_tasks: "include/podman.yml"
tags: "services:setup_system:podman"
- name: "play:services : role:setup_system : tasks:directories"
ansible.builtin.import_tasks: "include/directories.yml"
tags: "services:setup_system:directories"
- name: "play:services : role:setup_system : tasks:nameserver"
ansible.builtin.import_tasks: "include/nameserver.yml"
tags: "services:setup_system:nameserver"
- name: "play:services : role:setup_system : tasks:veth"
ansible.builtin.import_tasks: "include/veth.yml"
tags: "services:setup_system:veth"
- name: "play:services : role:setup_system : tasks:auto_update"
ansible.builtin.import_tasks: "include/auto_update.yml"
tags: "services:setup_system:auto_update"

View File

@ -1,45 +0,0 @@
- name: "play:services : role:setup_user:{{ services_service_name }} : tasks:vars"
ansible.builtin.import_role:
name: "include"
tasks_from: "vars"
tags:
- "services:setup_user:user"
- "services:setup_user:{{ services_service_name }}:user"
- "services:setup_user:directories"
- "services:setup_user:{{ services_service_name }}:directories"
- "services:setup_user:podman"
- "services:setup_user:{{ services_service_name }}:podman"
- "services:setup_user:auto_update"
- "services:setup_user:{{ services_service_name }}:auto_update"
- "services:setup_user:veth"
- "services:setup_user:{{ services_service_name }}:veth"
- name: "play:services : role:setup_user:{{ services_service_name }} : tasks:user"
ansible.builtin.import_tasks: "include/user.yml"
tags:
- "services:setup_user:user"
- "services:setup_user:{{ services_service_name }}:user"
- name: "play:services : role:setup_user:{{ services_service_name }} : tasks:directories"
ansible.builtin.import_tasks: "include/directories.yml"
tags:
- "services:setup_user:directories"
- "services:setup_user:{{ services_service_name }}:directories"
- name: "play:services : role:setup_user:{{ services_service_name }} : tasks:podman"
ansible.builtin.import_tasks: "include/podman.yml"
tags:
- "services:setup_user:podman"
- "services:setup_user:{{ services_service_name }}:podman"
- name: "play:services : role:setup_user:{{ services_service_name }} : tasks:auto_update"
ansible.builtin.import_tasks: "include/auto_update.yml"
tags:
- "services:setup_user:auto_update"
- "services:setup_user:{{ services_service_name }}:auto_update"
- name: "play:services : role:setup_user:{{ services_service_name }} : tasks:veth"
ansible.builtin.import_tasks: "include/veth.yml"
tags:
- "services:setup_user:veth"
- "services:setup_user:{{ services_service_name }}:veth"

View File

@ -23,24 +23,24 @@
community.general.filesystem:
dev: "/dev/rpool/var/lib/{{ ansible_hostname }}/containers"
fstype: "ext4"
register: services_datasets_system_zvol_format
register: services_system_datasets_zvol_format
- block:
- name: "get containers zvol uuid"
ansible.builtin.command: >-
blkid -s UUID -o value /dev/rpool/var/lib/{{ ansible_hostname }}/containers
register: services_datasets_system_zvol_uuid
register: services_system_datasets_zvol_uuid
- name: "system : add fstab entry and mount containers zvol"
ansible.posix.mount:
path: "/var/lib/{{ ansible_hostname }}/containers"
src: "UUID={{ services_datasets_system_zvol_uuid.stdout }}"
src: "UUID={{ services_system_datasets_zvol_uuid.stdout }}"
fstype: "ext4"
state: "mounted"
when:
services_datasets_system_zvol_format.changed
services_system_datasets_zvol_format.changed
- name: "create data root dataset"
community.general.zfs:

View File

@ -1,14 +1,14 @@
- name: "nameserver : fetch valkyrie's resolv.conf"
ansible.builtin.fetch:
src: "/etc/resolv.conf"
dest: "./files/setup_system/nameserver/"
dest: "./files/system_setup/nameserver/"
flat: true
when:
ansible_hostname == "valkyrie"
- name: "nameserver : copy valkyrie's resolv.conf to other hosts"
ansible.builtin.copy:
src: "../../../files/setup_system/nameserver/resolv.conf"
src: "../../../files/system_setup/nameserver/resolv.conf"
dest: "/var/lib/{{ ansible_hostname }}/valkyrie-resolv.conf"
when:
ansible_hostname != "valkyrie"

View File

@ -1,9 +1,9 @@
- name: "podman : install podman"
ansible.builtin.apt:
name: "podman"
register: services_system_podman_install
register: services_system_setup_podman_install
- name: "podman : reboot host"
ansible.builtin.reboot:
when:
services_system_podman_install.changed
services_system_setup_podman_install.changed

View File

@ -3,18 +3,18 @@
src: "./veth/connect-pod-service@.service"
dest: "/etc/systemd/system/connect-pod-service@.service"
mode: 0644
register: services_system_connect_pod_service_service_file
register: services_system_setup_connect_pod_service_service_file
- name: "veth : configure connect-pod-service path trigger"
ansible.builtin.template:
src: "./veth/connect-pod-service@.path.j2"
dest: "/etc/systemd/system/connect-pod-service@.path"
mode: 0644
register: services_system_connect_pod_service_path_file
register: services_system_setup_connect_pod_service_path_file
- name: "veth : systemd daemon reload"
ansible.builtin.systemd:
daemon_reload: true
when:
services_system_connect_pod_service_service_file.changed or
services_system_connect_pod_service_path_file.changed
services_system_setup_connect_pod_service_service_file.changed or
services_system_setup_connect_pod_service_path_file.changed

View File

@ -0,0 +1,19 @@
- name: "play:services : role:system_setup : tasks:podman"
ansible.builtin.import_tasks: "include/podman.yml"
tags: "services:system_setup:podman"
- name: "play:services : role:system_setup : tasks:directories"
ansible.builtin.import_tasks: "include/directories.yml"
tags: "services:system_setup:directories"
- name: "play:services : role:system_setup : tasks:nameserver"
ansible.builtin.import_tasks: "include/nameserver.yml"
tags: "services:system_setup:nameserver"
- name: "play:services : role:system_setup : tasks:veth"
ansible.builtin.import_tasks: "include/veth.yml"
tags: "services:system_setup:veth"
- name: "play:services : role:system_setup : tasks:auto_update"
ansible.builtin.import_tasks: "include/auto_update.yml"
tags: "services:system_setup:auto_update"

View File

@ -7,7 +7,7 @@
community.general.zfs:
name: "rpool/var/lib/{{ ansible_hostname }}/home/{{ services_service_user_name }}"
state: "present"
register: services_datasets_user_zfs_home
register: services_user_datasets_zfs_home
- name: "{{ services_service_name }} : populate home dataset with skeleton"
ansible.builtin.copy:
@ -15,7 +15,7 @@
dest: "{{ services_service_user_home }}"
remote_src: true
when:
services_datasets_user_zfs_home.changed
services_user_datasets_zfs_home.changed
- name: "{{ services_service_name }} : create data dataset"
community.general.zfs:

View File

@ -7,6 +7,6 @@ argument_specs:
services_service_name:
type: "str"
required: true
services_base_bridge_gateway:
services_bridge_gateway:
type: "str"
required: true

View File

@ -9,7 +9,7 @@
- name: "{{ services_service_name }} : directories : check if \"{{ services_service_volume.key }}\" mount exists"
ansible.builtin.stat:
path: "/var/lib/{{ ansible_hostname }}/data/{{ services_service_user_name }}/{{ services_service_volume.key }}/_data"
register: services_base_user_volume_mount
register: services_user_setup_volume_mount
- name: "{{ services_service_name }} : directories : create \"{{ services_service_volume.key }}\" mount"
ansible.builtin.file:
@ -19,4 +19,4 @@
group: "{{ services_service_user_name }}"
mode: 0755
when:
not services_base_user_volume_mount.stat.exists
not services_user_setup_volume_mount.stat.exists

View File

@ -11,11 +11,11 @@
src: "./podman/storage.conf.j2"
dest: "{{ services_service_user_home }}/.config/containers/storage.conf"
mode: 0644
register: services_base_user_containers_storage
register: services_user_setup_containers_storage
- name: "{{ services_service_name }} : podman : reset podman"
ansible.builtin.shell: "cd $HOME; yes | podman system reset"
when:
services_base_user_containers_storage.changed
services_user_setup_containers_storage.changed
become_user: "{{ services_service_user_name }}"

View File

@ -0,0 +1,55 @@
- name: "play:services : role:user_setup:{{ services_service_name }} : tasks:vars"
ansible.builtin.import_role:
name: "include"
tasks_from: "vars"
tags:
- "services:user_setup:user"
- "services:user_setup:{{ services_service_name }}:user"
- "services:{{ services_service_name }}:user_setup:user"
- "services:user_setup:directories"
- "services:user_setup:{{ services_service_name }}:directories"
- "services:{{ services_service_name }}:user_setup:directories"
- "services:user_setup:podman"
- "services:user_setup:{{ services_service_name }}:podman"
- "services:{{ services_service_name }}:user_setup:podman"
- "services:user_setup:auto_update"
- "services:user_setup:{{ services_service_name }}:auto_update"
- "services:{{ services_service_name }}:user_setup:auto_update"
- "services:user_setup:veth"
- "services:user_setup:{{ services_service_name }}:veth"
- "services:{{ services_service_name }}:user_setup:veth"
- name: "play:services : role:user_setup:{{ services_service_name }} : tasks:user"
ansible.builtin.import_tasks: "include/user.yml"
tags:
- "services:user_setup:user"
- "services:user_setup:{{ services_service_name }}:user"
- "services:{{ services_service_name }}:user_setup:user"
- name: "play:services : role:user_setup:{{ services_service_name }} : tasks:directories"
ansible.builtin.import_tasks: "include/directories.yml"
tags:
- "services:user_setup:directories"
- "services:user_setup:{{ services_service_name }}:directories"
- "services:{{ services_service_name }}:user_setup:directories"
- name: "play:services : role:user_setup:{{ services_service_name }} : tasks:podman"
ansible.builtin.import_tasks: "include/podman.yml"
tags:
- "services:user_setup:podman"
- "services:user_setup:{{ services_service_name }}:podman"
- "services:{{ services_service_name }}:user_setup:podman"
- name: "play:services : role:user_setup:{{ services_service_name }} : tasks:auto_update"
ansible.builtin.import_tasks: "include/auto_update.yml"
tags:
- "services:user_setup:auto_update"
- "services:user_setup:{{ services_service_name }}:auto_update"
- "services:{{ services_service_name }}:user_setup:auto_update"
- name: "play:services : role:user_setup:{{ services_service_name }} : tasks:veth"
ansible.builtin.import_tasks: "include/veth.yml"
tags:
- "services:user_setup:veth"
- "services:user_setup:{{ services_service_name }}:veth"
- "services:{{ services_service_name }}:user_setup:veth"

View File

@ -1,18 +1,18 @@
- name: "services : system : asgard"
hosts: "asgard"
tasks:
- name: "datasets_system"
- name: "system_datasets"
ansible.builtin.include_role:
name: "datasets_system"
name: "system_datasets"
apply:
tags: "services:datasets_system"
tags: "services:system_datasets"
when:
"'zfs' in group_names"
tags: "always"
- ansible.builtin.import_role:
name: "setup_system"
tags: "services:setup_system"
name: "system_setup"
tags: "services:system_setup"
- name: "set service bridge addresses"
ansible.builtin.set_fact:

View File

@ -9,26 +9,30 @@
www: {}
tags: "always"
- name: "setup_user"
- name: "user_setup"
ansible.builtin.include_role:
name: "setup_user"
name: "user_setup"
apply:
tags:
- "services:setup_user"
- "services:setup_user:{{ services_service_name }}"
- "services:user_setup"
- "services:user_setup:{{ services_service_name }}"
- "services:{{ services_service_name }}"
- "services:{{ services_service_name }}:user_setup"
vars:
services_service_name: "rproxy"
services_service_volumes: "{{ services_valkyrie_volumes[services_service_name] }}"
services_service_user_shell: "/usr/bin/rbash"
tags: "always"
- name: "setup_user"
- name: "user_setup"
ansible.builtin.include_role:
name: "setup_user"
name: "user_setup"
apply:
tags:
- "services:setup_user"
- "services:setup_user:{{ services_service_name }}"
- "services:user_setup"
- "services:user_setup:{{ services_service_name }}"
- "services:{{ services_service_name }}"
- "services:{{ services_service_name }}:user_setup"
vars:
services_service_name: "www"
services_service_volumes: "{{ services_valkyrie_volumes[services_service_name] }}"

View File

@ -29,13 +29,15 @@
data:
tags: "always"
- name: "datasets_user"
- name: "user_datasets"
ansible.builtin.include_role:
name: "datasets_user"
name: "user_datasets"
apply:
tags:
- "services:datasets_user"
- "services:datasets_user:{{ services_service_name }}"
- "services:user_datasets"
- "services:user_datasets:{{ services_service_name }}"
- "services:{{ services_service_name }}"
- "services:{{ services_service_name }}:user_datasets"
vars:
services_service_volumes: "{{ services_yggdrasil_volumes[services_service_name] }}"
loop: "{{ services_yggdrasil_services }}"
@ -43,13 +45,15 @@
loop_var: "services_service_name"
tags: "always"
- name: "setup_user"
- name: "user_setup"
ansible.builtin.include_role:
name: "setup_user"
name: "user_setup"
apply:
tags:
- "services:setup_user"
- "services:setup_user:{{ services_service_name }}"
- "services:user_setup"
- "services:user_setup:{{ services_service_name }}"
- "services:{{ services_service_name }}"
- "services:{{ services_service_name }}:user_setup"
vars:
services_service_volumes: "{{ services_yggdrasil_volumes[services_service_name] }}"
loop: "{{ services_yggdrasil_services }}"