Skip to content
Snippets Groups Projects
Verified Commit 20bb55ec authored by Chris Croome's avatar Chris Croome
Browse files

add apache_install tag to local facts tasks

parent 686bdae4
No related branches found
No related tags found
No related merge requests found
Pipeline #36454 passed
...@@ -10,7 +10,7 @@ By default this role uses [mod_md](https://github.com/icing/mod_md/) for HTTPS c ...@@ -10,7 +10,7 @@ By default this role uses [mod_md](https://github.com/icing/mod_md/) for HTTPS c
## Usage ## Usage
Run this role using the `apache_local_facts` tag for the intial install. Run this role using the `apache_install` tag for the intial install, once `apache2` has been installed the role can be run in check mode.
## Role variables ## Role variables
......
...@@ -39,6 +39,15 @@ ...@@ -39,6 +39,15 @@
manager: apt manager: apt
when: ansible_facts.packages is not defined when: ansible_facts.packages is not defined
- name: The apache2 package is required to be installed for the tasks in this role to run
ansible.builtin.assert:
that:
- ( "apache2" in ansible_facts.packages.keys() )
quiet: "{% if ansible_check_mode or ansible_verbosity >= 1 %}false{% else %}true{% endif %}"
fail_msg: >-
Please run this role with the apache_install tag to just install apache2, once apache2 is installed
this role can be run in check mode.
- name: Set a fact for the Apache apt package version - name: Set a fact for the Apache apt package version
ansible.builtin.set_fact: ansible.builtin.set_fact:
apache_version: >- apache_version: >-
......
...@@ -38,4 +38,5 @@ ...@@ -38,4 +38,5 @@
tags: tags:
- apache - apache
- apache_local_facts - apache_local_facts
- apache_install
... ...
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
when: not apache | bool when: not apache | bool
tags: tags:
- apache - apache
- apache_install
- apache_local_facts
- name: Install and configure Apache - name: Install and configure Apache
block: block:
...@@ -24,6 +26,7 @@ ...@@ -24,6 +26,7 @@
- apache_verify is defined - apache_verify is defined
- apache_verify | bool - apache_verify | bool
tags: tags:
- apache_install
- apache_local_facts - apache_local_facts
- name: Include apt role local fact tasks - name: Include apt role local fact tasks
...@@ -35,6 +38,7 @@ ...@@ -35,6 +38,7 @@
( ansible_facts.ansible_local.gpg.version is not defined ) or ( ansible_facts.ansible_local.gpg.version is not defined ) or
( ansible_facts.ansible_local.bash.path is not defined ) ( ansible_facts.ansible_local.bash.path is not defined )
tags: tags:
- apache_install
- apache_local_facts - apache_local_facts
- name: Packages present and absent - name: Packages present and absent
...@@ -71,12 +75,14 @@ ...@@ -71,12 +75,14 @@
( ( apache_pkgs_absent is defined ) and ( apache_pkgs_absent != [] ) ) or ( ( apache_pkgs_absent is defined ) and ( apache_pkgs_absent != [] ) ) or
( ( apache_pkgs_present is defined ) and ( apache_pkgs_present != [] ) ) ( ( apache_pkgs_present is defined ) and ( apache_pkgs_present != [] ) )
tags: tags:
- apache_install
- apache_local_facts - apache_local_facts
- name: Include local facts tasks - name: Include local facts tasks
ansible.builtin.include_tasks: local_facts.yml ansible.builtin.include_tasks: local_facts.yml
when: ansible_facts.ansible_local.a2query is not defined when: ansible_facts.ansible_local.a2query is not defined
tags: tags:
- apache_install
- apache_local_facts - apache_local_facts
- name: Include Apache checks - name: Include Apache checks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment