Skip to content

Commit 6fbc986

Browse files
authored
Merge pull request #211 from EESSI/ansible_managed_overlays
Let Ansible configure custom overlays
2 parents 661d4f3 + 61ff414 commit 6fbc986

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml

+5-14
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,17 @@
55
cmd: emerge gentoolkit
66
creates: "{{ gentoo_prefix_path }}/usr/bin/equery"
77

8-
- name: Install eselect-repository
9-
community.general.portage:
10-
package: eselect-repository
11-
state: present
12-
138
# We need git in order to add Gentoo overlays hosted on git repositories.
149
- name: Install git
1510
community.general.portage:
1611
package: dev-vcs/git
1712
state: present
1813

19-
- name: Check which repositories have been installed
20-
ansible.builtin.command: eselect repository list -i
21-
register: repositories_installed
22-
changed_when: false
23-
24-
- name: Add custom overlay configuration
25-
ansible.builtin.command:
26-
cmd: "eselect repository add {{ item.name }} {{ item.source }} {{ item.url }}"
27-
when: item.name not in repositories_installed.stdout
14+
- name: Add configuration files for custom overlays
15+
ansible.builtin.template:
16+
src: overlay.conf.j2
17+
dest: "{{ gentoo_prefix_path }}/etc/portage/repos.conf/{{ item.name }}.conf"
18+
mode: "0644"
2819
loop: "{{ custom_overlays }}"
2920

3021
- name: Make configuration file with overlays that can override eclasses
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# {{ ansible_managed }}
2+
[{{ item.name }}]
3+
location = {{ gentoo_prefix_path }}/var/db/repos/{{ item.name }}
4+
sync-type = {{ item.source }}
5+
sync-uri = {{ item.url }}
6+
{% if item.branch is defined %}
7+
sync-git-clone-extra-opts = --branch {{ item.branch }}
8+
{% endif %}

0 commit comments

Comments
 (0)