Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
apache
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
webarch
apache
Commits
5c1be6ca
Commit
5c1be6ca
authored
2 years ago
by
Chris Croome
Browse files
Options
Downloads
Patches
Plain Diff
Generate local_facts using a2query
parent
0e464423
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#20416
passed
2 years ago
Stage: lint
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
defaults/main.yml
+1
-0
1 addition, 0 deletions
defaults/main.yml
tasks/local_facts.yml
+34
-0
34 additions, 0 deletions
tasks/local_facts.yml
tasks/main.yml
+3
-0
3 additions, 0 deletions
tasks/main.yml
templates/a2query.fact.j2
+17
-0
17 additions, 0 deletions
templates/a2query.fact.j2
with
55 additions
and
0 deletions
defaults/main.yml
+
1
−
0
View file @
5c1be6ca
...
...
@@ -28,6 +28,7 @@ apache_dhparam_path: /etc/apache2/dhparam.pem
apache_dhparam_size
:
2048
apache_localhost_port
:
80
apache_ulimit
:
65536
apache_a2query
:
/usr/sbin/a2query
apache_packages_present
:
-
lynx
# - libapache2-mod-fcgid
...
...
This diff is collapsed.
Click to expand it.
tasks/local_facts.yml
0 → 100644
+
34
−
0
View file @
5c1be6ca
---
-
name
:
Ansible local facts
block
:
-
name
:
Required packages present
ansible.builtin.apt
:
pkg
:
-
jo
state
:
present
-
name
:
Ansible facts.d directory present
ansible.builtin.file
:
path
:
/etc/ansible/facts.d
recurse
:
true
state
:
directory
mode
:
0700
owner
:
root
group
:
root
-
name
:
Ansible a2query local facts script present
ansible.builtin.template
:
src
:
a2query.fact.j2
dest
:
/etc/ansible/facts.d/a2query.fact
mode
:
0700
owner
:
root
group
:
root
-
name
:
Re-read Ansible local facts
ansible.builtin.setup
:
filter
:
ansible_local
tags
:
-
quota
...
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
3
−
0
View file @
5c1be6ca
...
...
@@ -28,6 +28,9 @@
update_cache
:
false
when
:
( apache_packages_present is defined ) and ( apache_packages_present != [] )
-
name
:
Include local facts tasks
include_tasks
:
local_facts.yml
-
name
:
Include Apache checks
include_tasks
:
checks.yml
...
...
This diff is collapsed.
Click to expand it.
templates/a2query.fact.j2
0 → 100644
+
17
−
0
View file @
5c1be6ca
#!/usr/bin/env bash
# {{ ansible_managed }}
set
-euo
pipefail
IFS
=
$'
\n
'
A2QUERY
=
"{{ apache_a2query }}"
if
[[
-f
"
${
A2QUERY
}
"
]]
;
then
jo
state
=
present
version
=
$(
${
A2QUERY
}
-v
)
mpm
=
$(
${
A2QUERY
}
-M
)
\
conf_enabled
=
$(
${
A2QUERY
}
-c
|
awk
'{ print $1 }'
|
sort
| jo
-a
)
\
modules_enabled
=
$(
${
A2QUERY
}
-m
|
awk
'{ print $1 }'
|
sort
| jo
-a
)
\
sites_enabled
=
$(
${
A2QUERY
}
-s
|
awk
'{ print $1 }'
|
sort
| jo
-a
)
else
jo
state
=
absent
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment