Skip to content

Commit

Permalink
Add repository as vars (fix #18) & use builtin task apt_repo and yum_…
Browse files Browse the repository at this point in the history
…repo instead of blob files (#21)

Use variables instead of a file to deploy repositories
  • Loading branch information
ClementJ35 authored Aug 19, 2024
1 parent 9c9c5ea commit 3612933
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
17 changes: 17 additions & 0 deletions roles/install/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,20 @@ lemonldap_webserver_conf:
- manager
- portal
- test

lemonldap_apt_repositories:
- deb http://lemonldap-ng.org/deb stable main
- deb-src http://lemonldap-ng.org/deb stable main

lemonldap_yum_repositories:
- name: LemonLDAP::NG packages
baseurl: https://lemonldap-ng.org/redhat/stable/$releasever/noarch/
enabled: true
gpgcheck: true
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OW2

- name: LemonLDAP::NG sources
baseurl: https://lemonldap-ng.org/redhat/stable/$releasever/SRPMS/
enabled: false
gpgcheck: true
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OW2
3 changes: 0 additions & 3 deletions roles/install/files/debian_lemonldap-ng.list

This file was deleted.

13 changes: 0 additions & 13 deletions roles/install/files/redhat_lemonldap-ng.repo

This file was deleted.

12 changes: 6 additions & 6 deletions roles/install/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
file: /tmp/gpg-key-ow2
state: present

# Defined in defaults/main.yml
- name: Install LLNG Debian Repository
ansible.builtin.copy:
src: debian_lemonldap-ng.list
dest: /etc/apt/sources.list.d/lemonldap-ng.list
owner: root
group: root
mode: 0644
ansible.builtin.apt_repository:
repo: '{{ item }}'
state: present
filename: lemonldap-ng.list
loop: '{{ lemonldap_apt_repositories }}'
register: llng_repo

- name: Install Webserver and dependencies
Expand Down
14 changes: 8 additions & 6 deletions roles/install/tasks/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
ansible.builtin.command:
cmd: dnf -y config-manager --set-enabled {{ powertools_repo }}

# Defined in defaults/main.yml
- name: Install LLNG Enterprise Linux Repository
ansible.builtin.copy:
src: redhat_lemonldap-ng.repo
dest: /etc/yum.repos.d/lemonldap-ng.repo
owner: root
group: root
mode: 0644
ansible.builtin.yum_repository:
name: '{{ item.name }}'
baseurl: '{{ item.baseurl }}'
file: /etc/yum.repos.d/lemonldap-ng.repo
gpgcheck: '{{ item.gpgcheck }}'
gpgkey: '{{ item.gpgkey }}'
loop: '{{ lemonldap_yum_repositories }}'
register: llng_repo

- name: Install Webserver and dependencies
Expand Down

0 comments on commit 3612933

Please sign in to comment.