diff --git a/playbooks/apt_repositories.yml b/playbooks/apt_repositories.yml new file mode 100644 index 0000000..1ef4201 --- /dev/null +++ b/playbooks/apt_repositories.yml @@ -0,0 +1,39 @@ +--- +- name: Manage APT Repositories + hosts: harbor.guaranteedstruggle.host + become: true # Required for managing system-level configurations + + tasks: + - ansible.builtin.apt_repository: + repo: 'deb https://nexus.guaranteedstruggle.host/repository/generic-deb-debian-org/ bookworm main non-free-firmware' # Replace with your desired repository + state: present + #filename: custom-repo # Optional: specify a filename for the .list file + - ansible.builtin.apt_repository: + repo: 'deb-src https://nexus.guaranteedstruggle.host/repository/generic-deb-debian-org/ bookworm main non-free-firmware' # Replace with your desired repository + state: present + + - ansible.builtin.apt_repository: + repo: 'deb https://nexus.guaranteedstruggle.host/repository/generic-security-debian/ bookworm-security main non-free-firmware' # Replace with your desired repository + state: present + - ansible.builtin.apt_repository: + repo: 'deb-src https://nexus.guaranteedstruggle.host/repository/generic-security-debian/ bookworm-security main non-free-firmware' # Replace with your desired repository + state: present + + - ansible.builtin.apt_repository: + repo: 'deb https://nexus.guaranteedstruggle.host/repository/generic-deb-debian-org/ bookworm-updates main non-free-firmware' # Replace with your desired repository + state: present + - ansible.builtin.apt_repository: + repo: 'deb-src https://nexus.guaranteedstruggle.host/repository/generic-deb-debian-org/ bookworm-updates main non-free-firmware' # Replace with your desired repository + state: present + + # - name: Disable an existing APT repository (by commenting out its entry) + # ansible.builtin.lineinfile: + # path: /etc/apt/sources.list # Replace with the path to the .list file of the repository to disable + # regexp: '^(http://security.debian.org/debian-security .*)$' # Matches lines starting with 'deb ' + # line: '# \g<1>' # Comments out the matched line + # backrefs: true # Required to use backreferences in the 'line' parameter + # state: present # Ensure the line is present (commented out) + + - name: Ensure apt cache is updated after changes + ansible.builtin.apt: + update_cache: yes \ No newline at end of file