Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
php
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
php
Commits
1aaaea11
Commit
1aaaea11
authored
2 years ago
by
Chris Croome
Browse files
Options
Downloads
Patches
Plain Diff
Use apt repo for ansible_local facts
parent
52d7be8f
No related branches found
No related tags found
1 merge request
!1
Merge Sury
Pipeline
#25765
passed
2 years ago
Stage: lint
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
files/dpkg.fact
+0
-12
0 additions, 12 deletions
files/dpkg.fact
tasks/local_facts.yml
+0
-66
0 additions, 66 deletions
tasks/local_facts.yml
tasks/main.yml
+8
-5
8 additions, 5 deletions
tasks/main.yml
with
8 additions
and
83 deletions
files/dpkg.fact
deleted
100644 → 0
+
0
−
12
View file @
52d7be8f
#!/usr/bin/env bash
# Ansible managed
set
-euo
pipefail
DPKG
=
"/usr/bin/dpkg"
if
[[
-f
"
${
DPKG
}
"
]]
;
then
ARCH
=
$(
"
${
DPKG
}
"
--print-architecture
)
jo
state
=
present
arch
=
"
${
ARCH
}
"
else
jo
state
=
absent
fi
This diff is collapsed.
Click to expand it.
tasks/local_facts.yml
deleted
100644 → 0
+
0
−
66
View file @
52d7be8f
---
-
name
:
Ansible phpquery local facts
block
:
-
name
:
Required packages present
ansible.builtin.apt
:
pkg
:
-
aptitude
-
jo
state
:
present
-
name
:
Ansible facts.d directory present
ansible.builtin.file
:
path
:
/etc/ansible/facts.d
recurse
:
true
state
:
directory
mode
:
0755
owner
:
root
group
:
root
-
name
:
Ansible local facts scripts present
ansible.builtin.copy
:
src
:
"
{{
script
}}"
dest
:
"
/etc/ansible/facts.d/{{
script
}}"
mode
:
0755
owner
:
root
group
:
root
validate
:
bash -n %s
loop
:
-
dpkg.fact
# - php_cfg.fact
# - php_mod.fact
# - php_pkg.fact
loop_control
:
loop_var
:
script
register
:
php_local
-
name
:
Re-read Ansible local facts
ansible.builtin.setup
:
filter
:
ansible_local
when
:
php_local.changed
-
name
:
Print Ansible local dpkg facts
ansible.builtin.debug
:
var
:
ansible_local.dpkg
verbosity
:
2
# - name: Print Ansible local PHP configuration facts
# ansible.builtin.debug:
# var: ansible_local.php_cfg
# verbosity: 2
# - name: Print Ansible local PHP module facts
# ansible.builtin.debug:
# var: ansible_local.php_mod
# verbosity: 2
# - name: Print Ansible local PHP packages facts
# ansible.builtin.debug:
# var: ansible_local.php_pkg
# verbosity: 2
tags
:
-
php
-
php_local_facts
...
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
8
−
5
View file @
1aaaea11
...
...
@@ -2,11 +2,14 @@
-
name
:
PHP
block
:
-
name
:
Local facts tasks
ansible.builtin.include_tasks
:
local_facts.yml
when
:
ansible_local.dpkg is not defined
tags
:
-
php_local_facts
-
name
:
Include apt role local fact tasks if variables are not defined
ansible.builtin.include_role
:
name
:
apt
tasks_from
:
local_facts.yml
when
:
>-
( ansible_local.dpkg.arch is not defined ) or
( ansible_local.gpg.version is not defined ) or
( ansible_local.bash.path is not defined )
-
name
:
Sury apt repo config
ansible.builtin.include_tasks
:
apt.yml
...
...
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