Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Francois Le Corre
slapos.package
Commits
910d2148
Commit
910d2148
authored
Sep 14, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm-boostrap playbook: skip some tasks when playbook is well configured
parent
8e7d5a06
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
7 deletions
+25
-7
playbook/imt-vm-bootstrap.yml
playbook/imt-vm-bootstrap.yml
+14
-5
playbook/roles/vm-bootstrap/tasks/hostname.yml
playbook/roles/vm-bootstrap/tasks/hostname.yml
+1
-0
playbook/roles/vm-bootstrap/tasks/main.yml
playbook/roles/vm-bootstrap/tasks/main.yml
+3
-0
playbook/roles/vm-bootstrap/tasks/ssh.yml
playbook/roles/vm-bootstrap/tasks/ssh.yml
+2
-1
playbook/roles/vm-bootstrap/tasks/upgrader.yml
playbook/roles/vm-bootstrap/tasks/upgrader.yml
+3
-0
playbook/roles/vm-bootstrap/tasks/user.yml
playbook/roles/vm-bootstrap/tasks/user.yml
+2
-1
No files found.
playbook/imt-vm-bootstrap.yml
View file @
910d2148
...
...
@@ -2,7 +2,16 @@
hosts
:
127.0.0.1
connection
:
local
pre_tasks
:
-
name
:
Get mounted disk list
script
:
roles/vm-bootstrap/files/mounted_disk
register
:
vd_list
-
name
:
resgister completed variable
stat
:
path=/etc/opt/vm-bootstrap-completed
register
:
ansible_completed
vars
:
is_playbook_ok
:
"
{{
ansible_completed.stat.exists
}}"
logrotate_args
:
-
name
:
vm-bootstrap
path
:
/var/log/vm-bootstrap.log
...
...
@@ -14,11 +23,6 @@
-
create
-
dateext
pre_tasks
:
-
name
:
Get mounted disk list
script
:
roles/vm-bootstrap/files/mounted_disk
register
:
vd_list
roles
:
-
{
role
:
vm-bootstrap
,
startup_playbook_id
:
imt-vm-bootstrap.yml
}
-
ntp
...
...
@@ -44,4 +48,9 @@
-
{
role
:
vm-disks
,
vd_disk
:
u
,
data_n
:
12
,
when
:
vd_list.stdout.find("vdu") != -1
}
-
role
:
logrotate
logrotate_scripts
:
"
{{logrotate_args}}"
when
:
ansible_completed.stat.exists == False
tasks
:
-
name
:
Set tasks complete
file
:
path=/etc/opt/vm-bootstrap-completed state=touch
changed_when
:
false
playbook/roles/vm-bootstrap/tasks/hostname.yml
View file @
910d2148
...
...
@@ -59,6 +59,7 @@
-
name
:
Delete nameserver 8.8.8.8
lineinfile
:
dest=/etc/resolv.conf line="nameserver 8.8.8.8" state=absent
when
:
is_playbook_ok == "False"
-
name
:
Turn off dhclient if it's running
shell
:
pkill dhclient
...
...
playbook/roles/vm-bootstrap/tasks/main.yml
View file @
910d2148
-
include
:
uploadlog.yml
when
:
is_playbook_ok == "False"
-
include
:
rerun.yml
when
:
is_playbook_ok == "False"
-
name
:
Create /etc/opt dir
file
:
dest=/etc/opt mode=775 state=directory
...
...
@@ -49,6 +51,7 @@
-
include
:
hostname.yml
-
include
:
user.yml
-
include
:
sudo.yml
when
:
is_playbook_ok == "False"
-
include
:
ssh.yml
-
file
:
path=/opt/upgrader state=directory
...
...
playbook/roles/vm-bootstrap/tasks/ssh.yml
View file @
910d2148
...
...
@@ -51,11 +51,12 @@
always_run
:
True
ignore_errors
:
True
changed_when
:
False
when
:
is_playbook_ok == "False"
-
name
:
update /etc/ssh/sshd_config
lineinfile
:
dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (.*)" line="PermitRootLogin no" state=present
notify
:
-
restart ssh
-
restart sshd
when
:
permitrootlogin.rc !=
0
when
:
is_playbook_ok == "False" and
permitrootlogin.rc !=
0
playbook/roles/vm-bootstrap/tasks/upgrader.yml
View file @
910d2148
---
-
name
:
Remove playbook completed file
file
:
path=/etc/opt/vm-bootstrap-completed state=absent
-
file
:
path=/opt/upgrader state=directory mode=0755
-
stat
:
path=/opt/upgrader/current-upgrade-signature
...
...
playbook/roles/vm-bootstrap/tasks/user.yml
View file @
910d2148
...
...
@@ -7,4 +7,5 @@
user
:
name={{ item }} state=absent
with_items
:
-
slapos
-
nexedi
\ No newline at end of file
-
nexedi
when
:
is_playbook_ok == "False"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment