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
Lu Xu
slapos.package
Commits
4d8869ac
Commit
4d8869ac
authored
Jul 31, 2019
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook: don't remove slapos user until netadmin is in sudoers
parent
fa36a275
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
23 deletions
+19
-23
playbook/roles/vm-bootstrap/tasks/main.yml
playbook/roles/vm-bootstrap/tasks/main.yml
+0
-2
playbook/roles/vm-bootstrap/tasks/sudo.yml
playbook/roles/vm-bootstrap/tasks/sudo.yml
+0
-21
playbook/roles/vm-bootstrap/tasks/user.yml
playbook/roles/vm-bootstrap/tasks/user.yml
+19
-0
No files found.
playbook/roles/vm-bootstrap/tasks/main.yml
View file @
4d8869ac
...
...
@@ -41,8 +41,6 @@
-
include
:
network.yml
-
include
:
hostname.yml
-
include
:
user.yml
-
include
:
sudo.yml
when
:
is_playbook_ok in [False, "False"]
-
include
:
ssh.yml
-
name
:
Enable hotplugged CPU and Memory automatically
...
...
playbook/roles/vm-bootstrap/tasks/sudo.yml
deleted
100644 → 0
View file @
fa36a275
---
-
name
:
Ensure sudo is installed
apt
:
name=sudo state=latest update_cache=yes cache_valid_time=86400
when
:
ansible_os_family == "Debian"
-
include
:
../../yum/tasks/main.yml name=sudo cache_valid_time=86400
when
:
ansible_os_family == "RedHat"
-
name
:
Ensure /etc/sudoers.d directory is present
file
:
path=/etc/sudoers.d state=directory
-
name
:
Ensure /etc/sudoers.d is scanned by sudo
action
:
lineinfile dest=/etc/sudoers regexp="#includedir\s+/etc/sudoers.d" line="#includedir /etc/sudoers.d"
-
name
:
Add hadoop user to the sudoers
lineinfile
:
dest=/etc/sudoers.d/netadmin state=present create=yes regexp="netadmin .*" line="netadmin ALL=(root) NOPASSWD:ALL"
-
name
:
Ensure /etc/sudoers.d/netadmin file has correct permissions
action
:
file path=/etc/sudoers.d/netadmin mode=0440 state=file owner=root group=root
playbook/roles/vm-bootstrap/tasks/user.yml
View file @
4d8869ac
...
...
@@ -3,6 +3,25 @@
-
name
:
create netadmin
user
:
name=netadmin shell=/bin/bash groups=root password=$6$rounds=100000$RcjiHRBJa/ORaqst$0L2hFmL5kwGpP6sY2r.hENK3DR5YLdlSDf.r57hwsLjKioYx36CdeLso.52av1UA61rhWIJWdoRYI5bFz.RAC1 update_password=on_create
-
name
:
Ensure sudo is installed
apt
:
name=sudo state=latest update_cache=yes cache_valid_time=86400
when
:
ansible_os_family == "Debian"
-
include
:
../../yum/tasks/main.yml name=sudo cache_valid_time=86400
when
:
ansible_os_family == "RedHat"
-
name
:
Ensure /etc/sudoers.d directory is present
file
:
path=/etc/sudoers.d state=directory
-
name
:
Ensure /etc/sudoers.d is scanned by sudo
action
:
lineinfile dest=/etc/sudoers regexp="#includedir\s+/etc/sudoers.d" line="#includedir /etc/sudoers.d"
-
name
:
Add netadmin user to the sudoers
lineinfile
:
dest=/etc/sudoers.d/netadmin state=present create=yes regexp="netadmin .*" line="netadmin ALL=(root) NOPASSWD:ALL"
-
name
:
Ensure /etc/sudoers.d/netadmin file has correct permissions
action
:
file path=/etc/sudoers.d/netadmin mode=0440 state=file owner=root group=root
-
name
:
remove other unwanted users
user
:
name={{ item }} state=absent
with_items
:
...
...
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