From aea6156e8f716bb0fbb0b591393c95fc3188cd78 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 15 Aug 2023 21:34:48 +0200 Subject: debian_ppa -> apt_ppa --- roles/apt_ppa/README.md | 3 +++ roles/apt_ppa/defaults/main.yml | 1 + roles/apt_ppa/tasks/main.yml | 19 +++++++++++++++++++ roles/debian_ppa/README.md | 2 -- roles/debian_ppa/defaults/main.yml | 1 - roles/debian_ppa/tasks/main.yml | 19 ------------------- roles/linux_status/tasks/main.yml | 2 +- 7 files changed, 24 insertions(+), 23 deletions(-) create mode 100644 roles/apt_ppa/README.md create mode 100644 roles/apt_ppa/defaults/main.yml create mode 100644 roles/apt_ppa/tasks/main.yml delete mode 100644 roles/debian_ppa/README.md delete mode 100644 roles/debian_ppa/defaults/main.yml delete mode 100644 roles/debian_ppa/tasks/main.yml diff --git a/roles/apt_ppa/README.md b/roles/apt_ppa/README.md new file mode 100644 index 0000000..f7ce92c --- /dev/null +++ b/roles/apt_ppa/README.md @@ -0,0 +1,3 @@ +This role is used to enable an Ubuntu PPA repository; can be used on Debian as +well. It downloads the repository key and adds the repository in +/etc/apt/sources.list.d. diff --git a/roles/apt_ppa/defaults/main.yml b/roles/apt_ppa/defaults/main.yml new file mode 100644 index 0000000..72e0753 --- /dev/null +++ b/roles/apt_ppa/defaults/main.yml @@ -0,0 +1 @@ +ppa_keys_dir: /etc/apt/keyrings diff --git a/roles/apt_ppa/tasks/main.yml b/roles/apt_ppa/tasks/main.yml new file mode 100644 index 0000000..e6f3f04 --- /dev/null +++ b/roles/apt_ppa/tasks/main.yml @@ -0,0 +1,19 @@ +- name: Set up repository + become: true + block: + - name: Create keys directory + ansible.builtin.file: + path: '{{ ppa_keys_dir }}' + mode: '755' + state: directory + + - name: 'Add key: {{ ppa_name }}' + ansible.builtin.get_url: + url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x{{ ppa_key }}' + dest: '{{ ppa_keys_dir }}/{{ ppa_name }}.asc' + mode: '644' + + - name: 'Add repository: {{ ppa_name }}' + ansible.builtin.apt_repository: + repo: 'deb [signed-by={{ ppa_keys_dir }}/{{ ppa_name }}.asc] https://ppa.launchpadcontent.net/{{ ppa_owner }}/{{ ppa_name }}/ubuntu {{ ppa_distro }} main' + filename: '{{ ppa_name }}' diff --git a/roles/debian_ppa/README.md b/roles/debian_ppa/README.md deleted file mode 100644 index 310404f..0000000 --- a/roles/debian_ppa/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This role is used to enable an Ubuntu PPA repository on Debian. It downloads -the repository key and adds the repository in /etc/apt/sources.list.d. diff --git a/roles/debian_ppa/defaults/main.yml b/roles/debian_ppa/defaults/main.yml deleted file mode 100644 index 72e0753..0000000 --- a/roles/debian_ppa/defaults/main.yml +++ /dev/null @@ -1 +0,0 @@ -ppa_keys_dir: /etc/apt/keyrings diff --git a/roles/debian_ppa/tasks/main.yml b/roles/debian_ppa/tasks/main.yml deleted file mode 100644 index e6f3f04..0000000 --- a/roles/debian_ppa/tasks/main.yml +++ /dev/null @@ -1,19 +0,0 @@ -- name: Set up repository - become: true - block: - - name: Create keys directory - ansible.builtin.file: - path: '{{ ppa_keys_dir }}' - mode: '755' - state: directory - - - name: 'Add key: {{ ppa_name }}' - ansible.builtin.get_url: - url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x{{ ppa_key }}' - dest: '{{ ppa_keys_dir }}/{{ ppa_name }}.asc' - mode: '644' - - - name: 'Add repository: {{ ppa_name }}' - ansible.builtin.apt_repository: - repo: 'deb [signed-by={{ ppa_keys_dir }}/{{ ppa_name }}.asc] https://ppa.launchpadcontent.net/{{ ppa_owner }}/{{ ppa_name }}/ubuntu {{ ppa_distro }} main' - filename: '{{ ppa_name }}' diff --git a/roles/linux_status/tasks/main.yml b/roles/linux_status/tasks/main.yml index 1383699..8d6595c 100644 --- a/roles/linux_status/tasks/main.yml +++ b/roles/linux_status/tasks/main.yml @@ -1,6 +1,6 @@ - name: Set up repository ansible.builtin.include_role: - name: debian_ppa + name: apt_ppa vars: ppa_owner: egor-tensin ppa_name: linux-status -- cgit v1.2.3