File tree 4 files changed +28
-21
lines changed
4 files changed +28
-21
lines changed Original file line number Diff line number Diff line change 1
1
# ansible-oauth2-proxy
2
- An ansible role to install [ oauth2 proxy] ( https://github.com/bitly/oauth2_proxy )
2
+ An ansible role to install [ oauth2 proxy] ( https://github.com/bitly/oauth2_proxy )
3
3
4
4
Variables
5
5
---------
6
6
7
7
``` yaml
8
- oaut2_proxy_http : " https://github.com/bitly/oauth2_proxy /releases/download/v2.0.1/oauth2_proxy-2.0.1. linux-amd64.go1.4.2 .tar.gz"
9
- oaut2_proxy_http_sha256 : " c6d8f6d74e1958ce1688f3cf7d60648b9d0d6d4344d74c740c515a00b4e023ad "
8
+ oaut2_proxy_http : " https://github.com/oauth2-proxy/oauth2-proxy /releases/download/v7.1.3/oauth2-proxy-v7.1.3. linux-amd64.tar.gz"
9
+ oaut2_proxy_http_sha256 : " a491ca18059848c356935fe2ca9e665faafe4bba3ee1ecbac5a5f5f193195a82 "
10
10
oauth2_user : " oauth2"
11
11
oauth2_dir : " /var/oauth2_proxy"
12
12
oauth2_dir_tmp : " /var/oauth2_proxy/tmp"
@@ -19,15 +19,15 @@ oauth2_filename : "{{ oauth2_compress_filename |replace
19
19
oauth2_proxy_config :
20
20
http_address : " 127.0.0.1:5000"
21
21
upstreams : [ "127.0.0.1:6060" ]
22
- provider : " github"
22
+ provider : " github"
23
23
email-domain : " *"
24
24
cookie-secure : false
25
25
cookie-domain : " localhost:5000"
26
26
cookie_secret : " COOK_SECRET"
27
27
client_id : " YOUR_CLIENT_ID"
28
28
client_secret : " CLIENT_SECERET"
29
29
30
- oauth2_config_cmdline_args : " -github-org='MYCoolORg'"
30
+ oauth2_config_cmdline_args : " -- github-org='MYCoolORg'"
31
31
` ` `
32
32
33
33
Original file line number Diff line number Diff line change 1
1
---
2
2
3
- oaut2_proxy_http : " https://github.com/bitly/oauth2_proxy /releases/download/v2.0.1/oauth2_proxy-2.0.1. linux-amd64.go1.4.2 .tar.gz"
4
- oaut2_proxy_http_sha256 : " c6d8f6d74e1958ce1688f3cf7d60648b9d0d6d4344d74c740c515a00b4e023ad "
3
+ oaut2_proxy_http : " https://github.com/oauth2-proxy/oauth2-proxy /releases/download/v7.1.3/oauth2-proxy-v7.1.3. linux-amd64.tar.gz"
4
+ oaut2_proxy_http_sha256 : " a491ca18059848c356935fe2ca9e665faafe4bba3ee1ecbac5a5f5f193195a82 "
5
5
oauth2_user : " oauth2"
6
6
oauth2_dir : " /var/oauth2_proxy"
7
7
oauth2_dir_tmp : " /var/oauth2_proxy/tmp"
@@ -14,12 +14,12 @@ oauth2_filename : "{{ oauth2_compress_filename |replace
14
14
oauth2_proxy_config :
15
15
http_address : " 127.0.0.1:5000"
16
16
upstreams : [ "127.0.0.1:6060" ]
17
- provider : " github"
17
+ provider : " github"
18
18
email-domain : " *"
19
19
cookie-secure : false
20
20
cookie-domain : " localhost:5000"
21
21
cookie_secret : " COOK_SECRET"
22
22
client_id : " YOUR_CLIENT_ID"
23
23
client_secret : " CLIENT_SECERET"
24
24
25
- oauth2_config_cmdline_args : " -github-org='MYCoolORg'"
25
+ oauth2_config_cmdline_args : " -- github-org='MYCoolORg'"
Original file line number Diff line number Diff line change 1
1
---
2
2
3
3
- name : Create the directories for site specific configurations
4
- user :
4
+ user :
5
5
name="{{ oauth2_user }}"
6
6
shell="/bin/false"
7
7
home="{{ oauth2_dir }}"
8
8
9
9
- name : Create the directories for site specific configurations
10
- file :
10
+ file :
11
11
path="{{ item }}"
12
12
state=directory
13
13
owner="{{ oauth2_user }}"
26
26
owner="{{ oauth2_user }}"
27
27
28
28
- name : unarchive oauth2 binary
29
- unarchive :
29
+ unarchive :
30
30
src="{{ oauth2_dir_tmp }}/{{ oauth2_compress_filename }}"
31
31
dest="{{ oauth2_dir }}/"
32
32
creates="{{ oauth2_dir }}/{{ oauth2_compress_filename }}"
33
33
copy=no
34
34
35
35
- name : Create current symlink
36
- file :
36
+ file :
37
37
src="{{ oauth2_dir }}/{{ oauth2_filename }}"
38
38
dest="{{ oauth2_dir }}/current"
39
39
owner="{{ oauth2_user }}"
40
40
mode="0755"
41
41
state="link"
42
- notify :
42
+ notify :
43
43
- oauth2-proxy restart
44
44
45
45
- name : Deploy init.d script
46
- template :
46
+ template :
47
47
src="init.d.sh.j2.sh"
48
48
dest="/etc/init.d/oauth2-proxy"
49
49
mode="0755"
50
- notify :
50
+ register : initd_script
51
+ notify :
51
52
- oauth2-proxy restart
52
53
54
+ - name : Reload Systemd
55
+ systemd :
56
+ daemon_reload=yes
57
+ name=oauth2-proxy
58
+ when : initd_script.changed and ansible_service_mgr == 'systemd'
59
+
53
60
- name : Deploy Config
54
- template :
61
+ template :
55
62
src="config.j2"
56
63
dest="{{ oauth2_config_path }}"
57
64
owner="{{ oauth2_user }}"
58
65
mode="0600"
59
- notify :
66
+ notify :
60
67
- oauth2-proxy restart
61
68
62
69
- name : Service start
Original file line number Diff line number Diff line change 17
17
PATH=/sbin:/usr/sbin:/bin:/usr/bin
18
18
DESC=" A reverse proxy that provides authentication with Google, Github or other provider"
19
19
NAME=` basename $0 `
20
- DAEMON={{ oauth2_dir }}/current/oauth2_proxy
21
- DAEMON_ARGS=" -config={{ oauth2_config_path }} {{ oauth2_config_cmdline_args }}"
20
+ DAEMON={{ oauth2_dir }}/current/oauth2-proxy
21
+ DAEMON_ARGS=" -- config={{ oauth2_config_path }} {{ oauth2_config_cmdline_args }}"
22
22
PIDFILE=/var/run/$NAME .pid
23
23
SCRIPTNAME=/etc/init.d/oauth2-proxy
24
24
USER={{ oauth2_user }}
@@ -160,4 +160,4 @@ case "$1" in
160
160
;;
161
161
esac
162
162
163
- :
163
+ :
You can’t perform that action at this time.
0 commit comments