Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commonauth
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
commonauth
Commits
06909679
Commit
06909679
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible-playbooks/general#85 Linting
parent
8f0d766a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
defaults/main.yml
+2
-2
2 additions, 2 deletions
defaults/main.yml
tasks/initgroups.yml
+4
-3
4 additions, 3 deletions
tasks/initgroups.yml
tasks/inituser.yml
+8
-7
8 additions, 7 deletions
tasks/inituser.yml
tasks/main.yml
+27
-21
27 additions, 21 deletions
tasks/main.yml
with
41 additions
and
33 deletions
defaults/main.yml
+
2
−
2
View file @
06909679
tunnel_user_name
:
'
systunnel
'
tunnel_user_name
:
systunnel
jailusers
:
[]
initial_password
:
'
a4q7nsYju.N4I
'
initial_password
:
a4q7nsYju.N4I
# created with:
# python -c 'import crypt; print crypt.crypt("My First Password", "a4$6dZ8$FngnTn$x")'
# or:
...
...
This diff is collapsed.
Click to expand it.
tasks/initgroups.yml
+
4
−
3
View file @
06909679
...
...
@@ -3,14 +3,15 @@
-
block
:
-
name
:
"
Create
Jail
Group
"
-
name
:
Create Jail Group
group
:
name
:
'
{{
drupal.jail.name
}}'
when
:
drupal.jail is defined and drupal.jail.name is defined
-
name
:
"
Create
Git
Group
"
-
name
:
Create Git Group
group
:
name
:
'
{{
drupal.src.name
}}'
when
:
drupal.src is defined and drupal.src.name is defined
tags
:
'
SetPermissions'
tags
:
-
SetPermissions
This diff is collapsed.
Click to expand it.
tasks/inituser.yml
+
8
−
7
View file @
06909679
...
...
@@ -3,19 +3,19 @@
-
block
:
-
name
:
"
Create
User
"
-
name
:
Create User
user
:
name
:
'
{{
username
}}'
group
:
'
root
'
group
:
root
groups
:
"
{{
users[username].groups|default('www-data')
}}"
append
:
'
{{
append
}}'
home
:
'
/home/{{
username
}}
'
home
:
/home/{{ username }}
generate_ssh_key
:
yes
ssh_key_bits
:
2048
password
:
'
{{
initial_password
}}'
update_password
:
'
on_create
'
update_password
:
on_create
-
name
:
"
Add
User
to
Jail
Group
"
-
name
:
Add User to Jail Group
user
:
name
:
'
{{
username
}}'
groups
:
'
{{
item.jail.name
}}'
...
...
@@ -23,7 +23,7 @@
with_items
:
'
{{
drupal_settings|default([])
}}'
when
:
item.jail is defined and item.jail.users is defined and item.jail.name is defined and (username in item.jail.users or username in admins)
-
name
:
"
Add
User
to
Git
Group
"
-
name
:
Add User to Git Group
user
:
name
:
'
{{
username
}}'
groups
:
'
{{
item.src.name
}}'
...
...
@@ -31,4 +31,5 @@
with_items
:
'
{{
drupal_settings|default([])
}}'
when
:
item.src is defined and item.src.users is defined and item.src.name is defined and (username in item.src.users)
tags
:
'
SetPermissions'
tags
:
-
SetPermissions
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
27
−
21
View file @
06909679
---
# file: roles/commonauth/tasks/main.yml
-
name
:
"
Common
Auth
Role
"
-
name
:
Common Auth Role
set_fact
:
role_commonauth_started
:
true
tags
:
'
always'
tags
:
-
always
-
block
:
-
name
:
"
Set
default
facts
"
-
name
:
Set default facts
set_fact
:
append
:
yes
tags
:
'
always'
tags
:
-
always
-
name
:
"
Set
reset
facts
"
-
name
:
Set reset facts
set_fact
:
append
:
no
tags
:
'
Reset'
tags
:
-
Reset
-
name
:
"
Init
Gropus
"
include_tasks
:
'
initgroups.yml
'
-
name
:
Init Gropus
include_tasks
:
initgroups.yml
with_items
:
'
{{
drupal_settings|default([])
}}'
loop_control
:
loop_var
:
drupal
tags
:
-
'
SetPermissions
'
-
SetPermissions
-
name
:
"
Init
Users
"
include_tasks
:
'
inituser.yml
'
-
name
:
Init Users
include_tasks
:
inituser.yml
with_flattened
:
-
'
{{
admins
}}
'
-
'
{{
jailusers
}}
'
-
{{
admins
}}
-
{{
jailusers
}}
loop_control
:
loop_var
:
username
tags
:
-
'
SetPermissions
'
-
SetPermissions
-
name
:
"
Ensure
Extra
Users
"
-
name
:
Ensure Extra Users
user
:
name
:
'
{{
item.username
}}'
with_items
:
'
{{
auth_keys|default([])
}}'
tags
:
'
Keys'
tags
:
-
Keys
-
name
:
"
Install
Public
Key
For
Extra
Users
"
-
name
:
Install Public Key For Extra Users
authorized_key
:
user
:
'
{{
item.username
}}'
key
:
"
{{
lookup('file',
inventory_dir
+
'/files/keys/'
+
item.keyname
+
'.d2s.pub')
}}"
with_items
:
'
{{
auth_keys|default([])
}}'
tags
:
'
Keys'
tags
:
-
Keys
-
name
:
'
Remember
that
this
role
had
been
run
'
-
name
:
Remember that this role had been run
set_fact
:
role_commonauth_completed
:
true
tags
:
'
always'
tags
:
-
always
when
:
'
"commonauth"
not
in
excluded_roles
and
role_commonauth_completed
is
not
defined
'
when
:
not excluded_roles or
"commonauth" not in excluded_roles and role_commonauth_completed is not defined
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