Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
user-management
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
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
Ansible
Roles
user-management
Commits
e6bd68fb
Commit
e6bd68fb
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible-playbooks/general#85 Linting
parent
b7c970c6
Branches
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
tasks/cleanup.yml
+4
-4
4 additions, 4 deletions
tasks/cleanup.yml
tasks/main.yml
+1
-1
1 addition, 1 deletion
tasks/main.yml
with
5 additions
and
5 deletions
tasks/cleanup.yml
+
4
−
4
View file @
e6bd68fb
...
...
@@ -5,23 +5,23 @@
---
# file: cleanup.yml
-
name
:
"
Grab
the
user
list
"
-
name
:
Grab the user list
shell
:
cat /etc/passwd
register
:
passwd
-
name
:
"
Unlock
legitimate
user
accounts
"
-
name
:
Unlock legitimate user accounts
command
:
usermod --unlock {{item.split(':').0}}
when
:
item.split(':').0 in users
and item.split(':').2|int >
499
with_items
:
'
{{
passwd.stdout_lines
}}'
-
name
:
"
Lock
deprecated
user
accounts
"
-
name
:
Lock deprecated user accounts
command
:
usermod --lock {{item.split(':').0}}
when
:
item.split(':').0 not in users
and item.split(':').2|int >
499
with_items
:
'
{{
passwd.stdout_lines
}}'
-
name
:
"
Disable
ssh
keys
for
deprecated
user
accounts
"
-
name
:
Disable ssh keys for deprecated user accounts
command
:
rm {{item.split(':').5}}/.ssh/authorized_keys
when
:
item.split(':').0 not in users
and item.split(':').2|int >
499
...
...
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
1
−
1
View file @
e6bd68fb
...
...
@@ -5,7 +5,7 @@
---
# file: main.yml
-
name
:
"
Check
requirements:
is
the
user
hash
defined
"
-
name: Check requirements
:
is the user hash defined
local_action
:
shell echo "There are no users defined"
when
:
not users
changed_when
:
false
...
...
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