mirror of
https://gitea.0xace.cc/ansible-galaxy/consul.git
synced 2025-04-05 13:41:56 +00:00
Add http and https proxy support
This commit is contained in:
parent
9e46c26746
commit
45d907e336
@ -3,12 +3,18 @@
|
||||
name: gpg
|
||||
|
||||
- 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:
|
||||
url: "{{ item.url }}"
|
||||
keyring: "{{ item.keyring }}"
|
||||
loop: "{{ consul_apt_key }}"
|
||||
|
||||
- name: Add Hashicorp repository
|
||||
environment:
|
||||
http_proxy: "{{ consul_install_http_proxy | default(omit) }}"
|
||||
https_proxy: "{{ consul_install_https_proxy | default(omit) }}"
|
||||
apt_repository:
|
||||
repo: "{{ item.repo }}"
|
||||
state: present
|
||||
@ -25,10 +31,6 @@
|
||||
consul_installed_package: "{{ ansible_facts.packages[consul_package_name][0]['name'] }}"
|
||||
when: consul_package_name in ansible_facts.packages
|
||||
|
||||
- debug:
|
||||
msg: "{{ ansible_facts.packages[consul_package_name][0]['version'] }}"
|
||||
when: consul_installed_package is defined
|
||||
|
||||
- name: Mask Consul before install
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ consul_package_name }}"
|
||||
@ -36,6 +38,9 @@
|
||||
when: consul_package_name not in ansible_facts.packages or ansible_facts.packages[consul_package_name][0]['version'] != (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:
|
||||
name: "{{ consul_package }}-{{ consul_version_build }}"
|
||||
update_cache: yes
|
||||
@ -43,6 +48,9 @@
|
||||
when: consul_package_name not in ansible_facts.packages
|
||||
|
||||
- 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:
|
||||
name: "{{ consul_package }}-{{ consul_version_build }}"
|
||||
update_cache: yes
|
||||
|
@ -10,6 +10,9 @@
|
||||
when: consul_install_repo
|
||||
|
||||
- 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:
|
||||
name: "{{ consul_package }}"
|
||||
state: present
|
||||
@ -21,6 +24,9 @@
|
||||
when: consul_install_repo
|
||||
|
||||
- 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:
|
||||
name: "{{ consul_package }}"
|
||||
state: present
|
||||
|
Loading…
x
Reference in New Issue
Block a user