Co-authored-by: MKletz <michael.kletz.27@gmail.com> Co-authored-by: Ajay Chenampara <ajay.chenampara@gmail.com> Co-authored-by: dlemons-redhat <69318976+dlemons-redhat@users.noreply.github.com> Co-authored-by: Nicolas Leiva <nicolasleiva@gmail.com> Co-authored-by: benblasco <42140583+benblasco@users.noreply.github.com> Co-authored-by: Benjamin Blasco <bblasco@redhat.com> Co-authored-by: calvingsmith <4283930+calvingsmith@users.noreply.github.com> Co-authored-by: Calvin Smith <calvingsmith@users.noreply.github.com> Co-authored-by: Hicham Mourad <43329991+HichamMourad@users.noreply.github.com>
34 lines
1.0 KiB
YAML
34 lines
1.0 KiB
YAML
---
|
|
- name: Application deployment
|
|
hosts: "{{ _hosts | default('web') }}"
|
|
gather_facts: false
|
|
become: true
|
|
|
|
tasks:
|
|
- name: Make sure application is not empty
|
|
ansible.builtin.assert:
|
|
that:
|
|
- "application != ''"
|
|
|
|
- name: Printing to terminal application information
|
|
ansible.builtin.debug:
|
|
msg: "This Ansible Playbook will install {{ application }}"
|
|
|
|
- name: Install application
|
|
ansible.builtin.dnf:
|
|
name: "{{ application }}"
|
|
allow_downgrade: true
|
|
register: result
|
|
notify: Printing to terminal application information
|
|
|
|
- name: Printing to terminal application information # noqa: no-handler
|
|
ansible.builtin.debug:
|
|
msg: "The application: {{ application }} was already installed"
|
|
when: not result.changed | bool
|
|
|
|
handlers:
|
|
- name: Printing to terminal application information
|
|
ansible.builtin.debug:
|
|
msg: "The application: {{ application }} has been installed"
|
|
when: result.changed | bool
|