File tree Expand file tree Collapse file tree 4 files changed +28
-21
lines changed
Expand file tree Collapse file tree 4 files changed +28
-21
lines changed Original file line number Diff line number Diff line change 11# 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 )
33
44Variables
55---------
66
77``` 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 "
1010oauth2_user : " oauth2"
1111oauth2_dir : " /var/oauth2_proxy"
1212oauth2_dir_tmp : " /var/oauth2_proxy/tmp"
@@ -19,15 +19,15 @@ oauth2_filename : "{{ oauth2_compress_filename |replace
1919oauth2_proxy_config :
2020 http_address : " 127.0.0.1:5000"
2121 upstreams : [ "127.0.0.1:6060" ]
22- provider : " github"
22+ provider : " github"
2323 email-domain : " *"
2424 cookie-secure : false
2525 cookie-domain : " localhost:5000"
2626 cookie_secret : " COOK_SECRET"
2727 client_id : " YOUR_CLIENT_ID"
2828 client_secret : " CLIENT_SECERET"
2929
30- oauth2_config_cmdline_args : " -github-org='MYCoolORg'"
30+ oauth2_config_cmdline_args : " -- github-org='MYCoolORg'"
3131` ` `
3232
3333
Original file line number Diff line number Diff line change 11---
22
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 "
55oauth2_user : " oauth2"
66oauth2_dir : " /var/oauth2_proxy"
77oauth2_dir_tmp : " /var/oauth2_proxy/tmp"
@@ -14,12 +14,12 @@ oauth2_filename : "{{ oauth2_compress_filename |replace
1414oauth2_proxy_config :
1515 http_address : " 127.0.0.1:5000"
1616 upstreams : [ "127.0.0.1:6060" ]
17- provider : " github"
17+ provider : " github"
1818 email-domain : " *"
1919 cookie-secure : false
2020 cookie-domain : " localhost:5000"
2121 cookie_secret : " COOK_SECRET"
2222 client_id : " YOUR_CLIENT_ID"
2323 client_secret : " CLIENT_SECERET"
2424
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 11---
22
33- name : Create the directories for site specific configurations
4- user :
4+ user :
55 name="{{ oauth2_user }}"
66 shell="/bin/false"
77 home="{{ oauth2_dir }}"
88
99- name : Create the directories for site specific configurations
10- file :
10+ file :
1111 path="{{ item }}"
1212 state=directory
1313 owner="{{ oauth2_user }}"
2626 owner="{{ oauth2_user }}"
2727
2828- name : unarchive oauth2 binary
29- unarchive :
29+ unarchive :
3030 src="{{ oauth2_dir_tmp }}/{{ oauth2_compress_filename }}"
3131 dest="{{ oauth2_dir }}/"
3232 creates="{{ oauth2_dir }}/{{ oauth2_compress_filename }}"
3333 copy=no
3434
3535- name : Create current symlink
36- file :
36+ file :
3737 src="{{ oauth2_dir }}/{{ oauth2_filename }}"
3838 dest="{{ oauth2_dir }}/current"
3939 owner="{{ oauth2_user }}"
4040 mode="0755"
4141 state="link"
42- notify :
42+ notify :
4343 - oauth2-proxy restart
4444
4545- name : Deploy init.d script
46- template :
46+ template :
4747 src="init.d.sh.j2.sh"
4848 dest="/etc/init.d/oauth2-proxy"
4949 mode="0755"
50- notify :
50+ register : initd_script
51+ notify :
5152 - oauth2-proxy restart
5253
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+
5360- name : Deploy Config
54- template :
61+ template :
5562 src="config.j2"
5663 dest="{{ oauth2_config_path }}"
5764 owner="{{ oauth2_user }}"
5865 mode="0600"
59- notify :
66+ notify :
6067 - oauth2-proxy restart
6168
6269- name : Service start
Original file line number Diff line number Diff line change 1717PATH=/sbin:/usr/sbin:/bin:/usr/bin
1818DESC=" A reverse proxy that provides authentication with Google, Github or other provider"
1919NAME=` 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 }}"
2222PIDFILE=/var/run/$NAME .pid
2323SCRIPTNAME=/etc/init.d/oauth2-proxy
2424USER={{ oauth2_user }}
@@ -160,4 +160,4 @@ case "$1" in
160160 ;;
161161esac
162162
163- :
163+ :
You can’t perform that action at this time.
0 commit comments