mirror of
https://gitea.0xace.cc/ansible-galaxy/consul.git
synced 2025-04-06 06:01:57 +00:00
update consul
This commit is contained in:
parent
7eab49a6d2
commit
2eee7d69d3
@ -1,4 +1,4 @@
|
|||||||
consul_version: "1.12.9"
|
consul_version: "1.14.5"
|
||||||
consul_config_path: "/etc/consul.d"
|
consul_config_path: "/etc/consul.d"
|
||||||
consul_data_path: "/opt/consul"
|
consul_data_path: "/opt/consul"
|
||||||
consul_user: "consul"
|
consul_user: "consul"
|
||||||
|
@ -1,26 +1,23 @@
|
|||||||
- name: Add gpg package
|
- name: Install consul deps
|
||||||
apt:
|
apt:
|
||||||
name: gpg
|
name: "{{ consul_deps_packages }}"
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
- name: Add gpg keys for consul
|
- name: Add gpg keys for consul
|
||||||
environment:
|
|
||||||
http_proxy: "{{ consul_install_http_proxy | default(omit) }}"
|
|
||||||
https_proxy: "{{ consul_install_https_proxy | default(omit) }}"
|
|
||||||
ansible.builtin.apt_key:
|
ansible.builtin.apt_key:
|
||||||
url: "{{ item.url }}"
|
url: "{{ item.url }}"
|
||||||
keyring: "{{ item.keyring }}"
|
keyring: "{{ item.keyring }}"
|
||||||
|
when: consul_install_repo
|
||||||
loop: "{{ consul_apt_key }}"
|
loop: "{{ consul_apt_key }}"
|
||||||
|
|
||||||
- name: Add Hashicorp repository
|
- name: Add Hashicorp repository
|
||||||
environment:
|
|
||||||
http_proxy: "{{ consul_install_http_proxy | default(omit) }}"
|
|
||||||
https_proxy: "{{ consul_install_https_proxy | default(omit) }}"
|
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "{{ item.repo }}"
|
repo: "{{ item.repo }}"
|
||||||
state: present
|
state: present
|
||||||
filename: "{{ item.filename }}"
|
filename: "{{ item.filename }}"
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
loop: "{{ consul_apt_repository }}"
|
when: consul_install_repo
|
||||||
|
loop: "{{ consul_apt_repository }}"
|
||||||
|
|
||||||
- name: Gather packages
|
- name: Gather packages
|
||||||
package_facts:
|
package_facts:
|
||||||
@ -35,30 +32,24 @@
|
|||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: "{{ consul_package_name }}"
|
name: "{{ consul_package_name }}"
|
||||||
masked: yes
|
masked: yes
|
||||||
when: consul_package_name not in ansible_facts.packages or ansible_facts.packages[consul_package_name][0]['version'] != (consul_version + "-" + consul_version_build)
|
when: consul_package_name not in ansible_facts.packages or ansible_facts.packages[consul_package_name][0]['version'] != (consul_version|string + "-" + consul_version_build|string)
|
||||||
|
|
||||||
- name: "Install {{ consul_package_name }}-{{ consul_version }}-{{ consul_version_build }}"
|
- name: "Install {{ consul_package_name }}-{{ consul_version }}-{{ consul_version_build }}"
|
||||||
environment:
|
|
||||||
http_proxy: "{{ consul_install_http_proxy | default(omit) }}"
|
|
||||||
https_proxy: "{{ consul_install_https_proxy | default(omit) }}"
|
|
||||||
apt:
|
apt:
|
||||||
name: "{{ consul_package }}-{{ consul_version_build }}"
|
name: "{{ consul_package }}-{{ consul_version_build }}"
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
register: consul_setup
|
register: consul_setup
|
||||||
when: consul_package_name not in ansible_facts.packages
|
when: consul_package_name not in ansible_facts.packages
|
||||||
|
|
||||||
- name: "Update {{ consul_package_name }}-{{ consul_version }}-{{ consul_version_build }}"
|
- name: "Update {{ consul_package_name }}-{{ consul_version }}-{{ consul_version_build }}"
|
||||||
environment:
|
|
||||||
http_proxy: "{{ consul_install_http_proxy | default(omit) }}"
|
|
||||||
https_proxy: "{{ consul_install_https_proxy | default(omit) }}"
|
|
||||||
apt:
|
apt:
|
||||||
name: "{{ consul_package }}-{{ consul_version_build }}"
|
name: "{{ consul_package }}-{{ consul_version_build }}"
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
register: consul_setup
|
register: consul_setup
|
||||||
notify: Restart consul
|
notify: Restart consul
|
||||||
when:
|
when:
|
||||||
- consul_package_name in ansible_facts.packages
|
- consul_package_name in ansible_facts.packages
|
||||||
- ansible_facts.packages[consul_package_name][0]['version'] != (consul_version + "-" + consul_version_build)
|
- ansible_facts.packages[consul_package_name][0]['version'] != (consul_version|string + "-" + consul_version_build|string)
|
||||||
|
|
||||||
- name: Fix "/etc/consul.d/consul.env"
|
- name: Fix "/etc/consul.d/consul.env"
|
||||||
copy:
|
copy:
|
||||||
@ -66,4 +57,3 @@
|
|||||||
dest: /etc/consul.d/consul.env
|
dest: /etc/consul.d/consul.env
|
||||||
owner: consul
|
owner: consul
|
||||||
group: consul
|
group: consul
|
||||||
|
|
||||||
|
@ -10,9 +10,6 @@
|
|||||||
when: consul_install_repo
|
when: consul_install_repo
|
||||||
|
|
||||||
- name: "Install {{ consul_package_name }}-{{ consul_version }} from official repository"
|
- name: "Install {{ consul_package_name }}-{{ consul_version }} from official repository"
|
||||||
environment:
|
|
||||||
http_proxy: "{{ consul_install_http_proxy | default(omit) }}"
|
|
||||||
https_proxy: "{{ consul_install_https_proxy | default(omit) }}"
|
|
||||||
dnf:
|
dnf:
|
||||||
name: "{{ consul_package }}"
|
name: "{{ consul_package }}"
|
||||||
state: present
|
state: present
|
||||||
@ -24,9 +21,6 @@
|
|||||||
when: consul_install_repo
|
when: consul_install_repo
|
||||||
|
|
||||||
- name: "Install {{ consul_package_name }}-{{ consul_version }}"
|
- name: "Install {{ consul_package_name }}-{{ consul_version }}"
|
||||||
environment:
|
|
||||||
http_proxy: "{{ consul_install_http_proxy | default(omit) }}"
|
|
||||||
https_proxy: "{{ consul_install_https_proxy | default(omit) }}"
|
|
||||||
dnf:
|
dnf:
|
||||||
name: "{{ consul_package }}"
|
name: "{{ consul_package }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -6,6 +6,10 @@ consul_apt_key:
|
|||||||
consul_apt_repository:
|
consul_apt_repository:
|
||||||
- repo: deb [arch=amd64] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main
|
- repo: deb [arch=amd64] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main
|
||||||
filename: hashicorp
|
filename: hashicorp
|
||||||
|
|
||||||
|
consul_deps_packages:
|
||||||
|
- gnupg2
|
||||||
|
|
||||||
consul_version_build: "1"
|
consul_version_build: "1"
|
||||||
consul_package_name_regex: "{{ consul_package_name }}-{{ consul_version }}-{{ consul_version_build }}"
|
consul_package_name_regex: "{{ consul_package_name }}-{{ consul_version }}-{{ consul_version_build }}"
|
||||||
consul_ssl_update_ca_command: "update-ca-certificates --fresh"
|
consul_ssl_update_ca_command: "update-ca-certificates --fresh"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user