6 Commits
6 changed files with 27 additions and 11 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ uv.lock
/.devcontainer/ /.devcontainer/
.lock .lock
/.cache/ /.cache/
/roles/**/files/user/wg/containerized/*.conf /roles/**/files/user/wg/authorized_clients.d/*.conf
# Try tyo avoid any plain-text passwords # Try tyo avoid any plain-text passwords
*pwd* *pwd*
+6 -6
View File
@@ -89,7 +89,7 @@ Other common ones, especially for services, are `port` (which can be an integer
## Essential Usage ## Essential Usage
Before running any Ansible playbooks in either development or production mode, make sure to specify the username and the home directory path of the user on the system you are currently using in `{ANSIBLE_PROJECT_ROOT}/vars/local_facts.yml`. Before running any Ansible [playbooks](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_intro.html) in either development or production mode, make sure to specify the username and the home directory path of the user on the system you are currently using in `{ANSIBLE_PROJECT_ROOT}/vars/local_facts.yml`.
### Development Mode ### Development Mode
@@ -184,7 +184,7 @@ ansible-playbook -Kk -i hosts.yml --extra-vars "chosen_host=staging1.test" --ext
As long as you are matching the appropriate set of [playbook variable files](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_variables.html#defining-variables-in-included-files-and-roles) or settings files with the [playbook](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_intro.html) according to its need of those variable definitions/declarations, mostly determined by [the intended targeted hosts' own variables](https://docs.ansible.com/projects/ansible/latest/inventory_guide/intro_inventory.html#host-variables) together with role [handlers](https://docs.ansible.com/projects/ansible/latest/inventory_guide/intro_inventory.html#host-variables), and as long as you have appropriately set up software installations, (see [Software Management](#software-management)) creating new/custom [playbooks](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_intro.html) should be relatively easy. As long as you are matching the appropriate set of [playbook variable files](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_variables.html#defining-variables-in-included-files-and-roles) or settings files with the [playbook](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_intro.html) according to its need of those variable definitions/declarations, mostly determined by [the intended targeted hosts' own variables](https://docs.ansible.com/projects/ansible/latest/inventory_guide/intro_inventory.html#host-variables) together with role [handlers](https://docs.ansible.com/projects/ansible/latest/inventory_guide/intro_inventory.html#host-variables), and as long as you have appropriately set up software installations, (see [Software Management](#software-management)) creating new/custom [playbooks](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_intro.html) should be relatively easy.
Depending on what you are trying to do with a new playbook, the best approach may be to just copy/duplicate the extant playbook files and then edit them, as this allows one to mitigate errors as well as have a reliable reference point for changes. Depending on what you are trying to do with a new [playbook](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_intro.html), the best approach may be to just copy/duplicate the extant [playbook files](https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_intro.html) and then edit them, as this allows one to mitigate errors as well as have a reliable reference point for changes.
### CLI Tool ### CLI Tool
@@ -215,14 +215,14 @@ set -euo pipefail
INVENTORY_HOSTNAMES=(web1 web2) INVENTORY_HOSTNAMES=(web1 web2)
FQDN=web.site FQDN=web.site
./skato-ansible.sh init vps -v 3 -n "${INVENTORY_HOSTNAME[0]}" -d "$FQDN" ./skato-ansible.sh init vps -v 3 -n "${INVENTORY_HOSTNAMES[0]}" -d "$FQDN"
./skato-ansible.sh populate-agent staging ./skato-ansible.sh populate-agent staging
./skato-ansible.sh bootstrap vps -s 1 -v 3 -n "${INVENTORY_HOSTNAME[0]}" -d "$FQDN" ./skato-ansible.sh bootstrap vps -s 1 -v 3 -n "${INVENTORY_HOSTNAMES[0]}" -d "$FQDN"
./skato-ansible.sh init homeserver -v 3 -n "${INVENTORY_HOSTNAME[1]}" -d "$FQDN" ./skato-ansible.sh init homeserver -v 3 -n "${INVENTORY_HOSTNAMES[1]}" -d "$FQDN"
# BELOW ONLY IF $SKANSIBLE_SSH_KEY ALTERED IN THE SHELL SCRIPT # BELOW ONLY IF $SKANSIBLE_SSH_KEY ALTERED IN THE SHELL SCRIPT
# ./skato-ansible.sh populate-agent staging # ./skato-ansible.sh populate-agent staging
./skato-ansible.sh bootstrap vps -s 1 -v 3 -n "${INVENTORY_HOSTNAME[1]}" -d "$FQDN" ./skato-ansible.sh bootstrap vps -s 1 -v 3 -n "${INVENTORY_HOSTNAMES[1]}" -d "$FQDN"
``` ```
> [!IMPORTANT] > [!IMPORTANT]
+8
View File
@@ -195,6 +195,14 @@ pkgs:
suites: ~ suites: ~
comps: ~ comps: ~
handler: default handler: default
- name: "kitty-terminfo"
uri: ~
sigkey: ~
sources: ~
types: ~
suites: ~
comps: ~
handler: default
- name: "git-doc" - name: "git-doc"
uri: ~ uri: ~
sigkey: ~ sigkey: ~
+8
View File
@@ -409,6 +409,14 @@ pkgs:
suites: ~ suites: ~
comps: ~ comps: ~
handler: default handler: default
- name: minidlna
uri: ~
sigkey: ~
sources: ~
types: ~
suites: ~
comps: ~
handler: default
userspace: userspace:
- name: aria2 - name: aria2
uri: ~ uri: ~
@@ -83,7 +83,7 @@
- name: Dupliciating DSNet VPN service client configuration files to control node - name: Dupliciating DSNet VPN service client configuration files to control node
ansible.builtin.fetch: ansible.builtin.fetch:
src: "{{ ansible_user_home.stdout }}/.wg/authorized_clients.d/{{ item.name }}{{ (idx | string) }}.conf" src: "{{ ansible_user_home.stdout }}/.wg/authorized_clients.d/{{ item.name }}{{ (idx | string) }}.conf"
dest: "./roles/init-server/files/user/wg/containerized/{{ item.name }}{{ (idx | string) }}.conf" dest: "./roles/init-server/files/user/wg/authorized_clients.d/{{ item.name }}{{ (idx | string) }}.conf"
flat: true flat: true
loop: "{{ vpn.clients }}" loop: "{{ vpn.clients }}"
loop_control: loop_control:
@@ -173,7 +173,7 @@
block: block:
- name: Creating subdirectory for VPN client container specified by Compose file - name: Creating subdirectory for VPN client container specified by Compose file
ansible.builtin.file: ansible.builtin.file:
path: "{{ ansible_user_home.stdout }}/.wg/containerized" path: "{{ ansible_user_home.stdout }}/.wg/authorized_clients.d"
recurse: true recurse: true
owner: "{{ ansible_user }}" owner: "{{ ansible_user }}"
group: "{{ ansible_user }}" group: "{{ ansible_user }}"
@@ -183,8 +183,8 @@
become_user: "{{ current_user.stdout }}" become_user: "{{ current_user.stdout }}"
when: ((fqdn is defined and fqdn != None) and item.name == fqdn) or item.name == inventory_hostname when: ((fqdn is defined and fqdn != None) and item.name == fqdn) or item.name == inventory_hostname
ansible.builtin.copy: ansible.builtin.copy:
src: "user/wg/containerized/{{ item.name }}{{ (idx | string) }}.conf" src: "user/wg/authorized_clients.d/{{ item.name }}{{ (idx | string) }}.conf"
dest: "{{ ansible_user_home.stdout }}/.wg/containerized/" dest: "{{ ansible_user_home.stdout }}/.wg/authorized_clients.d/"
owner: "{{ ansible_user }}" owner: "{{ ansible_user }}"
group: "{{ ansible_user }}" group: "{{ ansible_user }}"
mode: "644" mode: "644"