Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayobe
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Very Demiurge Very Mindful
Kayobe
Commits
4a6bc785
Commit
4a6bc785
authored
3 years ago
by
Zuul
Committed by
Gerrit Code Review
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Switch to reboot module"
parents
174e3994
932a6199
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible/roles/disable-selinux/tasks/main.yml
+5
-25
5 additions, 25 deletions
ansible/roles/disable-selinux/tasks/main.yml
releasenotes/notes/fix-selinux-disable-reboot-65c32f5dc895211c.yaml
+6
-0
6 additions, 0 deletions
...es/notes/fix-selinux-disable-reboot-65c32f5dc895211c.yaml
with
11 additions
and
25 deletions
ansible/roles/disable-selinux/tasks/main.yml
+
5
−
25
View file @
4a6bc785
...
...
@@ -24,36 +24,16 @@
set_fact
:
is_local
:
"
{{
lookup('pipe',
'hostname')
in
[ansible_hostname,
ansible_nodename]
}}"
# Any SSH connection errors cause ansible to fail the task. We therefore
# perform a manual SSH connection and allow the command to fail.
-
name
:
Reboot the system to apply SELinux changes (remote)
local_action
:
# Use -tt to force a pseudo tty.
module
:
>
command
ssh -tt {{ ansible_user }}@{{ ansible_host | default(inventory_hostname) }}
sudo shutdown -r now "Applying SELinux changes"
register
:
reboot_result
failed_when
:
-
reboot_result is failed
-
"
'closed
by
remote
host'
not
in
reboot_result.stderr"
when
:
not is_local | bool
-
name
:
Reboot the system to apply SELinux changes (local)
command
:
shutdown -r now "Applying SELinux changes"
become
:
True
when
:
is_local | bool
# If we're running this locally we won't get here.
-
name
:
Wait for the system to boot up (remote)
local_action
:
module
:
wait_for
host
:
"
{{
ansible_host
|
default(inventory_hostname)
}}"
port
:
22
state
:
started
# Wait for 10 seconds before polling to ensure the node has shutdown.
delay
:
10
timeout
:
"
{{
disable_selinux_reboot_timeout
}}"
-
name
:
Reboot the machine to apply SELinux
reboot
:
reboot_timeout
:
"
{{
disable_selinux_reboot_timeout
}}"
msg
:
Applying SELinux changes
become
:
true
when
:
not is_local | bool
when
:
-
disable_selinux_do_reboot | bool
...
...
This diff is collapsed.
Click to expand it.
releasenotes/notes/fix-selinux-disable-reboot-65c32f5dc895211c.yaml
0 → 100644
+
6
−
0
View file @
4a6bc785
---
fixes
:
-
|
Fixes an issue where custom SSH arguments, such as when setting
``ansible_ssh_extra_args``, were not being respected when rebooting
a host to disable selinux.
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