mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-04-06 02:40:30 -07:00
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
---
|
|
- name: Display Ansible version
|
|
ansible.builtin.debug:
|
|
msg: "Ansible version is {{ ansible_version.full }}"
|
|
|
|
- name: "Set package name for sudo"
|
|
ansible.builtin.set_fact:
|
|
sudo_pkg_name: sudo
|
|
|
|
- name: "Ensure {{ sudo_pkg_name }} is installed (if user is root)."
|
|
ansible.builtin.yum:
|
|
name: "{{ sudo_pkg_name }}"
|
|
state: present
|
|
when:
|
|
- ansible_user_id == 'root'
|
|
|
|
- name: Gather the package facts
|
|
ansible.builtin.package_facts:
|
|
manager: auto
|
|
|
|
- name: "Check if sudo is installed."
|
|
ansible.builtin.assert:
|
|
that:
|
|
- sudo_pkg_name in ansible_facts.packages
|
|
fail_msg: "sudo is not installed on target system"
|
|
|
|
- name: "Install iproute"
|
|
become: true
|
|
ansible.builtin.yum:
|
|
name:
|
|
- iproute
|
|
state: present
|
|
|
|
- name: "Retrieve assets server from env"
|
|
ansible.builtin.set_fact:
|
|
assets_server: "{{ lookup('env', 'MIDDLEWARE_DOWNLOAD_RELEASE_SERVER_URL') }}"
|
|
|
|
- name: "Download artefacts only if assets_server is set"
|
|
when:
|
|
- assets_server is defined
|
|
- assets_server | length > 0
|
|
- assets is defined
|
|
- assets | length > 0
|
|
block:
|
|
- name: "Set offline when assets server from env is defined"
|
|
ansible.builtin.set_fact:
|
|
sso_offline_install: True
|
|
|
|
- name: "Download and deploy zips from {{ assets_server }}"
|
|
ansible.builtin.get_url:
|
|
url: "{{ asset }}"
|
|
dest: "{{ lookup('env', 'PWD') }}"
|
|
validate_certs: no
|
|
mode: '0644'
|
|
delegate_to: localhost
|
|
loop: "{{ assets }}"
|
|
loop_control:
|
|
loop_var: asset
|