Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
drupal
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
drupal
Commits
044f7420
Commit
044f7420
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible-inventories/arocom#2861 Add support for basic auth on certain locations only
parent
0550a759
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
tasks/apache_auth.yml
+14
-1
14 additions, 1 deletion
tasks/apache_auth.yml
templates/vhost.conf
+12
-2
12 additions, 2 deletions
templates/vhost.conf
with
26 additions
and
3 deletions
tasks/apache_auth.yml
+
14
−
1
View file @
044f7420
...
...
@@ -20,12 +20,13 @@
group
:
'
{{
apacheUser
}}'
mode
:
0640
state
:
'
{{
drupal_domain.apache_auth.password
is
defined|ternary("present","absent")
}}'
when
:
drupal_domain.apache_auth.user is defined
notify
:
-
Restart Apache
-
name
:
Setup AuthType Basic Credentials for extra users
htpasswd
:
path
:
'
{{
webRoot
}}/passwords/{{
drupal_domain.apache_auth.user
}}'
path
:
'
{{
webRoot
}}/passwords/{{
drupal_domain.apache_auth.user
|default(drupal.id)
}}'
name
:
'
{{
item.user
}}'
password
:
'
{{
item.password
}}'
owner
:
'
{{
apacheUser
}}'
...
...
@@ -35,5 +36,17 @@
notify
:
-
Restart Apache
-
name
:
Setup AuthType Basic Credentials for location users
htpasswd
:
path
:
'
{{
webRoot
}}/passwords/{{
drupal_domain.apache_auth.user|default(drupal.id)
}}'
name
:
'
{{
item.user
}}'
password
:
'
{{
item.password
}}'
owner
:
'
{{
apacheUser
}}'
group
:
'
{{
apacheUser
}}'
mode
:
0640
with_items
:
'
{{
drupal_domain.apache_auth.location_users|default([])
}}'
notify
:
-
Restart Apache
tags
:
-
ApacheConfig
This diff is collapsed.
Click to expand it.
templates/vhost.conf
+
12
−
2
View file @
044f7420
...
...
@@ -42,7 +42,7 @@
Header
always
add
Strict
-
Transport
-
Security
"max-age=15768000; includeSubDomains; preload"
{%
if
drupal_domain
.
mailhog
|
default
(
false
) %}
{%
if
drupal_domain
.
apache_auth
is
defined
and
drupal_domain
.
apache_auth
.
active
|
default
(
'true'
) ==
'true'
%}
{%
if
drupal_domain
.
apache_auth
is
defined
and
drupal_domain
.
apache_auth
.
user
is
defined
and
drupal_domain
.
apache_auth
.
active
|
default
(
'true'
) ==
'true'
%}
<
Location
/
mailhog
/>
AuthType
{{
drupal_domain
.
apache_auth
.
type
}}
AuthName
"{{ drupal_domain.apache_auth.name }}"
...
...
@@ -86,7 +86,7 @@
<
Directory
{{
docRoot
}}/>
Options
+
ExecCGI
+
Indexes
+
FollowSymLinks
+
MultiViews
AllowOverride
All
{%
if
drupal_domain
.
apache_auth
is
defined
and
drupal_domain
.
apache_auth
.
active
|
default
(
'true'
) ==
'true'
%}
{%
if
drupal_domain
.
apache_auth
is
defined
and
drupal_domain
.
apache_auth
.
user
is
defined
and
drupal_domain
.
apache_auth
.
active
|
default
(
'true'
) ==
'true'
%}
AuthType
{{
drupal_domain
.
apache_auth
.
type
}}
AuthName
"{{ drupal_domain.apache_auth.name }}"
AuthUserFile
{{
webRoot
}}/
passwords
/{{
drupal_domain
.
apache_auth
.
user
}}
...
...
@@ -130,6 +130,16 @@
{%
endif
%}
{%
endif
%}
</
Directory
>
{%
if
drupal_domain
.
apache_auth
is
defined
and
drupal_domain
.
apache_auth
.
location_users
is
defined
and
drupal_domain
.
apache_auth
.
active
|
default
(
'true'
) ==
'true'
%}
{%
for
location
in
drupal_domain
.
apache_auth
.
location_users
%}
<
Location
{{
location
.
location
}}>
AuthType
{{
drupal_domain
.
apache_auth
.
type
}}
AuthName
"{{ drupal_domain.apache_auth.name }}"
AuthUserFile
{{
webRoot
}}/
passwords
/{{
drupal_domain
.
apache_auth
.
user
|
default
(
drupal
.
id
) }}
Require
user
{{
location
.
user
}}
</
Location
>
{%
endfor
%}
{%
endif
%}
<
Directory
{{
docRoot
}}/.
git
/>
Require
all
denied
</
Directory
>
...
...
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