Match naming to ordering
This commit is contained in:
parent
2a694ac6ed
commit
6574b1c86b
@ -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"
|
|
@ -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"
|
|
@ -23,24 +23,24 @@
|
|||||||
community.general.filesystem:
|
community.general.filesystem:
|
||||||
dev: "/dev/rpool/var/lib/{{ ansible_hostname }}/containers"
|
dev: "/dev/rpool/var/lib/{{ ansible_hostname }}/containers"
|
||||||
fstype: "ext4"
|
fstype: "ext4"
|
||||||
register: services_datasets_system_zvol_format
|
register: services_system_datasets_zvol_format
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
|
||||||
- name: "get containers zvol uuid"
|
- name: "get containers zvol uuid"
|
||||||
ansible.builtin.command: >-
|
ansible.builtin.command: >-
|
||||||
blkid -s UUID -o value /dev/rpool/var/lib/{{ ansible_hostname }}/containers
|
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"
|
- name: "system : add fstab entry and mount containers zvol"
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/containers"
|
path: "/var/lib/{{ ansible_hostname }}/containers"
|
||||||
src: "UUID={{ services_datasets_system_zvol_uuid.stdout }}"
|
src: "UUID={{ services_system_datasets_zvol_uuid.stdout }}"
|
||||||
fstype: "ext4"
|
fstype: "ext4"
|
||||||
state: "mounted"
|
state: "mounted"
|
||||||
|
|
||||||
when:
|
when:
|
||||||
services_datasets_system_zvol_format.changed
|
services_system_datasets_zvol_format.changed
|
||||||
|
|
||||||
- name: "create data root dataset"
|
- name: "create data root dataset"
|
||||||
community.general.zfs:
|
community.general.zfs:
|
@ -1,14 +1,14 @@
|
|||||||
- name: "nameserver : fetch valkyrie's resolv.conf"
|
- name: "nameserver : fetch valkyrie's resolv.conf"
|
||||||
ansible.builtin.fetch:
|
ansible.builtin.fetch:
|
||||||
src: "/etc/resolv.conf"
|
src: "/etc/resolv.conf"
|
||||||
dest: "./files/setup_system/nameserver/"
|
dest: "./files/system_setup/nameserver/"
|
||||||
flat: true
|
flat: true
|
||||||
when:
|
when:
|
||||||
ansible_hostname == "valkyrie"
|
ansible_hostname == "valkyrie"
|
||||||
|
|
||||||
- name: "nameserver : copy valkyrie's resolv.conf to other hosts"
|
- name: "nameserver : copy valkyrie's resolv.conf to other hosts"
|
||||||
ansible.builtin.copy:
|
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"
|
dest: "/var/lib/{{ ansible_hostname }}/valkyrie-resolv.conf"
|
||||||
when:
|
when:
|
||||||
ansible_hostname != "valkyrie"
|
ansible_hostname != "valkyrie"
|
@ -1,9 +1,9 @@
|
|||||||
- name: "podman : install podman"
|
- name: "podman : install podman"
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "podman"
|
name: "podman"
|
||||||
register: services_system_podman_install
|
register: services_system_setup_podman_install
|
||||||
|
|
||||||
- name: "podman : reboot host"
|
- name: "podman : reboot host"
|
||||||
ansible.builtin.reboot:
|
ansible.builtin.reboot:
|
||||||
when:
|
when:
|
||||||
services_system_podman_install.changed
|
services_system_setup_podman_install.changed
|
@ -3,18 +3,18 @@
|
|||||||
src: "./veth/connect-pod-service@.service"
|
src: "./veth/connect-pod-service@.service"
|
||||||
dest: "/etc/systemd/system/connect-pod-service@.service"
|
dest: "/etc/systemd/system/connect-pod-service@.service"
|
||||||
mode: 0644
|
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"
|
- name: "veth : configure connect-pod-service path trigger"
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "./veth/connect-pod-service@.path.j2"
|
src: "./veth/connect-pod-service@.path.j2"
|
||||||
dest: "/etc/systemd/system/connect-pod-service@.path"
|
dest: "/etc/systemd/system/connect-pod-service@.path"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
register: services_system_connect_pod_service_path_file
|
register: services_system_setup_connect_pod_service_path_file
|
||||||
|
|
||||||
- name: "veth : systemd daemon reload"
|
- name: "veth : systemd daemon reload"
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
services_system_connect_pod_service_service_file.changed or
|
services_system_setup_connect_pod_service_service_file.changed or
|
||||||
services_system_connect_pod_service_path_file.changed
|
services_system_setup_connect_pod_service_path_file.changed
|
19
plays/services/roles/system_setup/tasks/main.yml
Normal file
19
plays/services/roles/system_setup/tasks/main.yml
Normal 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"
|
@ -7,7 +7,7 @@
|
|||||||
community.general.zfs:
|
community.general.zfs:
|
||||||
name: "rpool/var/lib/{{ ansible_hostname }}/home/{{ services_service_user_name }}"
|
name: "rpool/var/lib/{{ ansible_hostname }}/home/{{ services_service_user_name }}"
|
||||||
state: "present"
|
state: "present"
|
||||||
register: services_datasets_user_zfs_home
|
register: services_user_datasets_zfs_home
|
||||||
|
|
||||||
- name: "{{ services_service_name }} : populate home dataset with skeleton"
|
- name: "{{ services_service_name }} : populate home dataset with skeleton"
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
@ -15,7 +15,7 @@
|
|||||||
dest: "{{ services_service_user_home }}"
|
dest: "{{ services_service_user_home }}"
|
||||||
remote_src: true
|
remote_src: true
|
||||||
when:
|
when:
|
||||||
services_datasets_user_zfs_home.changed
|
services_user_datasets_zfs_home.changed
|
||||||
|
|
||||||
- name: "{{ services_service_name }} : create data dataset"
|
- name: "{{ services_service_name }} : create data dataset"
|
||||||
community.general.zfs:
|
community.general.zfs:
|
@ -7,6 +7,6 @@ argument_specs:
|
|||||||
services_service_name:
|
services_service_name:
|
||||||
type: "str"
|
type: "str"
|
||||||
required: true
|
required: true
|
||||||
services_base_bridge_gateway:
|
services_bridge_gateway:
|
||||||
type: "str"
|
type: "str"
|
||||||
required: true
|
required: true
|
@ -9,7 +9,7 @@
|
|||||||
- name: "{{ services_service_name }} : directories : check if \"{{ services_service_volume.key }}\" mount exists"
|
- name: "{{ services_service_name }} : directories : check if \"{{ services_service_volume.key }}\" mount exists"
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ services_service_user_name }}/{{ services_service_volume.key }}/_data"
|
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"
|
- name: "{{ services_service_name }} : directories : create \"{{ services_service_volume.key }}\" mount"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@ -19,4 +19,4 @@
|
|||||||
group: "{{ services_service_user_name }}"
|
group: "{{ services_service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
when:
|
when:
|
||||||
not services_base_user_volume_mount.stat.exists
|
not services_user_setup_volume_mount.stat.exists
|
@ -11,11 +11,11 @@
|
|||||||
src: "./podman/storage.conf.j2"
|
src: "./podman/storage.conf.j2"
|
||||||
dest: "{{ services_service_user_home }}/.config/containers/storage.conf"
|
dest: "{{ services_service_user_home }}/.config/containers/storage.conf"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
register: services_base_user_containers_storage
|
register: services_user_setup_containers_storage
|
||||||
|
|
||||||
- name: "{{ services_service_name }} : podman : reset podman"
|
- name: "{{ services_service_name }} : podman : reset podman"
|
||||||
ansible.builtin.shell: "cd $HOME; yes | podman system reset"
|
ansible.builtin.shell: "cd $HOME; yes | podman system reset"
|
||||||
when:
|
when:
|
||||||
services_base_user_containers_storage.changed
|
services_user_setup_containers_storage.changed
|
||||||
|
|
||||||
become_user: "{{ services_service_user_name }}"
|
become_user: "{{ services_service_user_name }}"
|
55
plays/services/roles/user_setup/tasks/main.yml
Normal file
55
plays/services/roles/user_setup/tasks/main.yml
Normal 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"
|
@ -1,18 +1,18 @@
|
|||||||
- name: "services : system : asgard"
|
- name: "services : system : asgard"
|
||||||
hosts: "asgard"
|
hosts: "asgard"
|
||||||
tasks:
|
tasks:
|
||||||
- name: "datasets_system"
|
- name: "system_datasets"
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: "datasets_system"
|
name: "system_datasets"
|
||||||
apply:
|
apply:
|
||||||
tags: "services:datasets_system"
|
tags: "services:system_datasets"
|
||||||
when:
|
when:
|
||||||
"'zfs' in group_names"
|
"'zfs' in group_names"
|
||||||
tags: "always"
|
tags: "always"
|
||||||
|
|
||||||
- ansible.builtin.import_role:
|
- ansible.builtin.import_role:
|
||||||
name: "setup_system"
|
name: "system_setup"
|
||||||
tags: "services:setup_system"
|
tags: "services:system_setup"
|
||||||
|
|
||||||
- name: "set service bridge addresses"
|
- name: "set service bridge addresses"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
@ -9,26 +9,30 @@
|
|||||||
www: {}
|
www: {}
|
||||||
tags: "always"
|
tags: "always"
|
||||||
|
|
||||||
- name: "setup_user"
|
- name: "user_setup"
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: "setup_user"
|
name: "user_setup"
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
- "services:setup_user"
|
- "services:user_setup"
|
||||||
- "services:setup_user:{{ services_service_name }}"
|
- "services:user_setup:{{ services_service_name }}"
|
||||||
|
- "services:{{ services_service_name }}"
|
||||||
|
- "services:{{ services_service_name }}:user_setup"
|
||||||
vars:
|
vars:
|
||||||
services_service_name: "rproxy"
|
services_service_name: "rproxy"
|
||||||
services_service_volumes: "{{ services_valkyrie_volumes[services_service_name] }}"
|
services_service_volumes: "{{ services_valkyrie_volumes[services_service_name] }}"
|
||||||
services_service_user_shell: "/usr/bin/rbash"
|
services_service_user_shell: "/usr/bin/rbash"
|
||||||
tags: "always"
|
tags: "always"
|
||||||
|
|
||||||
- name: "setup_user"
|
- name: "user_setup"
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: "setup_user"
|
name: "user_setup"
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
- "services:setup_user"
|
- "services:user_setup"
|
||||||
- "services:setup_user:{{ services_service_name }}"
|
- "services:user_setup:{{ services_service_name }}"
|
||||||
|
- "services:{{ services_service_name }}"
|
||||||
|
- "services:{{ services_service_name }}:user_setup"
|
||||||
vars:
|
vars:
|
||||||
services_service_name: "www"
|
services_service_name: "www"
|
||||||
services_service_volumes: "{{ services_valkyrie_volumes[services_service_name] }}"
|
services_service_volumes: "{{ services_valkyrie_volumes[services_service_name] }}"
|
||||||
|
@ -29,13 +29,15 @@
|
|||||||
data:
|
data:
|
||||||
tags: "always"
|
tags: "always"
|
||||||
|
|
||||||
- name: "datasets_user"
|
- name: "user_datasets"
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: "datasets_user"
|
name: "user_datasets"
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
- "services:datasets_user"
|
- "services:user_datasets"
|
||||||
- "services:datasets_user:{{ services_service_name }}"
|
- "services:user_datasets:{{ services_service_name }}"
|
||||||
|
- "services:{{ services_service_name }}"
|
||||||
|
- "services:{{ services_service_name }}:user_datasets"
|
||||||
vars:
|
vars:
|
||||||
services_service_volumes: "{{ services_yggdrasil_volumes[services_service_name] }}"
|
services_service_volumes: "{{ services_yggdrasil_volumes[services_service_name] }}"
|
||||||
loop: "{{ services_yggdrasil_services }}"
|
loop: "{{ services_yggdrasil_services }}"
|
||||||
@ -43,13 +45,15 @@
|
|||||||
loop_var: "services_service_name"
|
loop_var: "services_service_name"
|
||||||
tags: "always"
|
tags: "always"
|
||||||
|
|
||||||
- name: "setup_user"
|
- name: "user_setup"
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: "setup_user"
|
name: "user_setup"
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
- "services:setup_user"
|
- "services:user_setup"
|
||||||
- "services:setup_user:{{ services_service_name }}"
|
- "services:user_setup:{{ services_service_name }}"
|
||||||
|
- "services:{{ services_service_name }}"
|
||||||
|
- "services:{{ services_service_name }}:user_setup"
|
||||||
vars:
|
vars:
|
||||||
services_service_volumes: "{{ services_yggdrasil_volumes[services_service_name] }}"
|
services_service_volumes: "{{ services_yggdrasil_volumes[services_service_name] }}"
|
||||||
loop: "{{ services_yggdrasil_services }}"
|
loop: "{{ services_yggdrasil_services }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user