Skip to content

Commit

Permalink
Fix syntax error and remove repository from sources after successful …
Browse files Browse the repository at this point in the history
…install
  • Loading branch information
Maspital committed Jan 2, 2025
1 parent ffd3981 commit e04c6ca
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions provisioning/ansible/roles/external_mail_handler/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
# Additionally, creates a logrotate config file for logs
#

- name: Add Kali Linux archive repository
apt_repository:
repo: "deb http://old.kali.org/kali 2024.4 main contrib non-free"
state: present
trusted: yes # Bypass signature verification
- name: Add Kali Linux archive repository manually
copy:
dest: /etc/apt/sources.list.d/kali-archive.list
content: "deb [trusted=yes] http://old.kali.org/kali 2024.4 main contrib non-free"

- name: Update apt cache ignoring signature verification
shell: apt-get update -o Acquire::AllowInsecureRepositories=true -o Acquire::AllowDowngradeToInsecureRepositories=true
Expand All @@ -27,6 +26,16 @@
state: present
allow_downgrade: yes

- name: Remove Kali Linux archive repository after installing required packages
apt_repository:
repo: "deb http://old.kali.org/kali 2024.4 main contrib non-free"
state: absent

- name: Update apt cache after removing repository
shell: apt-get update
args:
warn: false

- name: "Create script directory {{ script_dir }}"
file:
path: "{{ script_dir }}"
Expand Down

0 comments on commit e04c6ca

Please sign in to comment.