diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e53cf5..a654411 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: mv tests/hosts.ini ./hosts.ini - uses: actions/setup-python@v4 with: - python-version: 3.8.9 + python-version: 3.11.4 - name: Install test dependencies. run: pip install -r requirements.txt - name: Install ansible dependencies. diff --git a/.github/workflows/delete-linode-instances.yml b/.github/workflows/delete-linode-instances.yml index c40f3bf..80e730c 100644 --- a/.github/workflows/delete-linode-instances.yml +++ b/.github/workflows/delete-linode-instances.yml @@ -32,7 +32,7 @@ jobs: mv tests/hosts.ini ./hosts.ini - uses: actions/setup-python@v4 with: - python-version: 3.8.9 + python-version: 3.11.4 - name: Install test dependencies. run: pip install -r requirements.txt - name: Delete Linode Instance diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1923f8d..40b3f29 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.8.9 + python-version: 3.11.4 - name: Create Vault Key run: echo "${{ secrets.VAULT_PASSWORD }}" > ~/.vault-key - name: Install dependencies @@ -34,7 +34,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.8.9 + python-version: 3.11.4 - name: Install dependencies run: make deps - name: Format code diff --git a/playbooks/backup-directories.yml b/playbooks/backup-directories.yml index 71048e5..45b7977 100644 --- a/playbooks/backup-directories.yml +++ b/playbooks/backup-directories.yml @@ -9,7 +9,8 @@ tags: [always] tasks: - - ansible.builtin.include_role: + - name: Backup Directories. + ansible.builtin.include_role: name: backup_directory with_items: "{{ backup_directories }}" loop_control: diff --git a/roles/backup_directory/tasks/main.yml b/roles/backup_directory/tasks/main.yml index 6728828..5f7d540 100644 --- a/roles/backup_directory/tasks/main.yml +++ b/roles/backup_directory/tasks/main.yml @@ -6,6 +6,7 @@ community.general.archive: path: "{{ backup.path }}" dest: /tmp/backup.tar.gz + mode: "0755" - name: Upload backups to S3 amazon.aws.aws_s3: @@ -20,6 +21,6 @@ permission: "{{ docker_backup_aws_s3_permissions }}" - name: Remove local backup. - file: + ansible.builtin.file: path: /tmp/backup.tar.gz state: absent diff --git a/roles/setup_hosted_services/tasks/main.yml b/roles/setup_hosted_services/tasks/main.yml index 95e3f2b..4f9c65c 100644 --- a/roles/setup_hosted_services/tasks/main.yml +++ b/roles/setup_hosted_services/tasks/main.yml @@ -70,14 +70,14 @@ loop_var: portainer_stack - name: Install Ansible pull - tags: [ "cron" ] + tags: ["cron"] ansible.builtin.pip: name: - ansible # TODO: need to specify ansible pull directly, it doesn't find it when it's in PATH - name: Ensure Nightly Cron Backups - tags: [ "cron" ] + tags: ["cron"] ansible.builtin.cron: name: backup docker volumes (nightly) weekday: "*" @@ -89,16 +89,3 @@ -U https://github.com/chatton/ansible-homelab playbooks/backup-docker-volumes.yml -e schedule=nightly >> ~/logs/nightly.log 2>&1 cron_file: ansible_nightly_docker_volume_backup state: present - -- name: Ensure Monthly Cron Backups - tags: [ "cron" ] - ansible.builtin.cron: - name: backup docker volumes (monthly) - month: "*" - day: "0" - user: "{{ homelab_user }}" - job: > - {{ ansible_pull_path }} - -U https://github.com/chatton/ansible-homelab playbooks/backup-docker-volumes.yml -e schedule=monthly >> ~/logs/monthly.log 2>&1 - cron_file: ansible_monthly_docker_volume_backup - state: present diff --git a/roles/setup_users/tasks/main.yml b/roles/setup_users/tasks/main.yml index c96e3b7..d9d2b29 100644 --- a/roles/setup_users/tasks/main.yml +++ b/roles/setup_users/tasks/main.yml @@ -43,14 +43,14 @@ mode: 0644 - name: Disable password authentication for root. - lineinfile: + ansible.builtin.lineinfile: path: /etc/ssh/sshd_config state: present regexp: '^#?PermitRootLogin' line: 'PermitRootLogin prohibit-password' - name: Disable password authentication for users. - lineinfile: + ansible.builtin.lineinfile: path: /etc/ssh/sshd_config state: present regexp: '^#?PasswordAuthentication'