2022-07-28 14:14:26 +00:00
|
|
|
- name: Add Hashicorp repository
|
|
|
|
yum_repository:
|
|
|
|
name: hashicorp
|
|
|
|
description: Hashicorp Stable - $basearch
|
|
|
|
file: hashicorp
|
|
|
|
baseurl: https://rpm.releases.hashicorp.com/RHEL/$releasever/$basearch/stable
|
2022-09-06 12:59:08 +00:00
|
|
|
enabled: yes
|
2022-07-28 14:14:26 +00:00
|
|
|
gpgcheck: yes
|
|
|
|
gpgkey: https://rpm.releases.hashicorp.com/gpg
|
2023-03-29 20:45:46 +00:00
|
|
|
when: consul_install_official_repo
|
2022-07-28 14:14:26 +00:00
|
|
|
|
|
|
|
- name: "Install {{ consul_package_name }}-{{ consul_version }} from official repository"
|
|
|
|
dnf:
|
|
|
|
name: "{{ consul_package }}"
|
|
|
|
state: present
|
|
|
|
disable_gpg_check: yes
|
|
|
|
enablerepo: hashicorp
|
|
|
|
update_cache: yes
|
2022-09-06 12:59:08 +00:00
|
|
|
disablerepo: '*'
|
2022-07-28 14:14:26 +00:00
|
|
|
register: consul_setup
|
2023-03-29 20:45:46 +00:00
|
|
|
when: consul_install_official_repo
|
2022-07-28 14:14:26 +00:00
|
|
|
|
|
|
|
- name: "Install {{ consul_package_name }}-{{ consul_version }}"
|
|
|
|
dnf:
|
|
|
|
name: "{{ consul_package }}"
|
|
|
|
state: present
|
|
|
|
disable_gpg_check: yes
|
|
|
|
register: consul_setup
|
2023-03-29 20:45:46 +00:00
|
|
|
when: not consul_install_official_repo
|
2022-07-28 14:14:26 +00:00
|
|
|
|
|
|
|
- name: Fix "/etc/consul.d/consul.env"
|
|
|
|
copy:
|
|
|
|
content: ""
|
|
|
|
dest: /etc/consul.d/consul.env
|
|
|
|
owner: consul
|
|
|
|
group: consul
|