diff --git a/inventory/serguzim.net.yml b/inventory/serguzim.net.yml index d1b31a1..f7226ba 100644 --- a/inventory/serguzim.net.yml +++ b/inventory/serguzim.net.yml @@ -19,7 +19,7 @@ all: host_backup: hc_uid: "{{ opentofu.healthchecksio.backup.node001.id }}" hc_url: "{{ opentofu.healthchecksio.backup.node001.ping_url }}" - gatus_token: "{{ vault_hosts.node001.backup.gatus_token }}" + gatus_token: "{{ vault_hosts.node001.backup.gatus_token }}" node003: ansible_host: "{{ opentofu.hosts.node003.fqdn_vpn }}" @@ -32,4 +32,4 @@ all: host_backup: hc_uid: "{{ opentofu.healthchecksio.backup.node003.id }}" hc_url: "{{ opentofu.healthchecksio.backup.node003.ping_url }}" - gatus_token: "{{ vault_hosts.node003.backup.gatus_token }}" + gatus_token: "{{ vault_hosts.node003.backup.gatus_token }}" diff --git a/playbooks/change-password.yml b/playbooks/change-password.yml index b8ed866..c070a30 100644 --- a/playbooks/change-password.yml +++ b/playbooks/change-password.yml @@ -3,12 +3,12 @@ hosts: all become: true tasks: - - name: Get new password - ansible.builtin.pause: - prompt: Enter the new password - echo: false - register: new_user_password - - name: Change password - ansible.builtin.user: - name: "{{ interactive_user }}" - password: "{{ new_user_password.user_input | password_hash('sha512') }}" + - name: Get new password + ansible.builtin.pause: + prompt: Enter the new password + echo: false + register: new_user_password + - name: Change password + ansible.builtin.user: + name: "{{ interactive_user }}" + password: "{{ new_user_password.user_input | password_hash('sha512') }}" diff --git a/playbooks/roles/deploy/vars/main.yml b/playbooks/roles/deploy/vars/main.yml index c1ac4bd..a418c28 100644 --- a/playbooks/roles/deploy/vars/main.yml +++ b/playbooks/roles/deploy/vars/main.yml @@ -30,4 +30,4 @@ deploy_compose: file: services: app: - command: ["-verbose", "-hooks=/config/hooks.yml", "-hotreload"] \ No newline at end of file + command: ["-verbose", "-hooks=/config/hooks.yml", "-hotreload"] diff --git a/playbooks/roles/forgejo_runner/files/config.yml b/playbooks/roles/forgejo_runner/files/config.yml index 3a46c2d..0388c17 100644 --- a/playbooks/roles/forgejo_runner/files/config.yml +++ b/playbooks/roles/forgejo_runner/files/config.yml @@ -7,13 +7,6 @@ runner: file: /data/.runner # Execute how many tasks concurrently at the same time. capacity: 1 - # Extra environment variables to run jobs. - #envs: - # A_TEST_ENV_NAME_1: a_test_env_value_1 - # A_TEST_ENV_NAME_2: a_test_env_value_2 - # Extra environment variables to run jobs from a file. - # It will be ignored if it's empty or the file doesn't exist. - #env_file: .env # The timeout for a job to be finished. # Please note that the Forgejo instance also has a timeout (3h by default) for the job. # So the job could be stopped by the Forgejo instance if it's timeout is shorter than this. diff --git a/playbooks/roles/node_exporter/tasks/main.yml b/playbooks/roles/node_exporter/tasks/main.yml index 10e8e99..87488af 100644 --- a/playbooks/roles/node_exporter/tasks/main.yml +++ b/playbooks/roles/node_exporter/tasks/main.yml @@ -1,4 +1,4 @@ --- - name: Deploy {{ role_name }} ansible.builtin.import_role: - name: prometheus.prometheus.node_exporter \ No newline at end of file + name: prometheus.prometheus.node_exporter diff --git a/playbooks/unlock-backup.yml b/playbooks/unlock-backup.yml index 40403e4..75c3501 100644 --- a/playbooks/unlock-backup.yml +++ b/playbooks/unlock-backup.yml @@ -3,7 +3,8 @@ hosts: serguzim_net become: true tasks: - - name: Unlock backups - ansible.builtin.shell: - cmd: autorestic unlock --force && autorestic exec -va unlock - chdir: "{{ (services_path, 'backup') | path_join }}" + - name: Unlock backups + ansible.builtin.shell: + cmd: autorestic unlock --force && autorestic exec -va unlock + chdir: "{{ (services_path, 'backup') | path_join }}" + changed_when: true diff --git a/scripts/new_role.sh b/scripts/new_role.sh index bad2558..e150bdf 100755 --- a/scripts/new_role.sh +++ b/scripts/new_role.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +template_dir="./templates/new_role" roles_dir="./playbooks/roles" read -p "Enter the new role name: " new_role @@ -14,6 +15,6 @@ if [ -d "$roles_dir/$new_role" ]; then exit 1 fi -cp -r "$roles_dir/_TEMPLATE" "$roles_dir/$new_role" +cp -r "$template_dir" "$roles_dir/$new_role" -sed -i "s/NAME_/${new_role}_/g" "$roles_dir/$new_role"/**/*.yml +sed -i "s/mynewrolename_/${new_role}_/g" "$roles_dir/$new_role"/**/*.yml diff --git a/playbooks/roles/_TEMPLATE/handlers/main.yml b/templates/new_role/handlers/main.yml similarity index 100% rename from playbooks/roles/_TEMPLATE/handlers/main.yml rename to templates/new_role/handlers/main.yml diff --git a/playbooks/roles/_TEMPLATE/tasks/main.yml b/templates/new_role/tasks/main.yml similarity index 100% rename from playbooks/roles/_TEMPLATE/tasks/main.yml rename to templates/new_role/tasks/main.yml diff --git a/playbooks/roles/_TEMPLATE/vars/main.yml b/templates/new_role/vars/main.yml similarity index 100% rename from playbooks/roles/_TEMPLATE/vars/main.yml rename to templates/new_role/vars/main.yml