Skip to content

Commit 7d53861

Browse files
authored
Merge pull request #5 from hellofresh/patch/EES-6532-use-latest-version
EES-6532 Use latest version
2 parents b34b139 + dfc3a42 commit 7d53861

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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

44
Variables
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"
1010
oauth2_user : "oauth2"
1111
oauth2_dir : "/var/oauth2_proxy"
1212
oauth2_dir_tmp : "/var/oauth2_proxy/tmp"
@@ -19,15 +19,15 @@ oauth2_filename : "{{ oauth2_compress_filename |replace
1919
oauth2_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

defaults/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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"
55
oauth2_user : "oauth2"
66
oauth2_dir : "/var/oauth2_proxy"
77
oauth2_dir_tmp : "/var/oauth2_proxy/tmp"
@@ -14,12 +14,12 @@ oauth2_filename : "{{ oauth2_compress_filename |replace
1414
oauth2_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'"

tasks/main.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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 }}"
@@ -26,37 +26,44 @@
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

templates/init.d.sh.j2.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
PATH=/sbin:/usr/sbin:/bin:/usr/bin
1818
DESC="A reverse proxy that provides authentication with Google, Github or other provider"
1919
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 }}"
2222
PIDFILE=/var/run/$NAME.pid
2323
SCRIPTNAME=/etc/init.d/oauth2-proxy
2424
USER={{ oauth2_user }}
@@ -160,4 +160,4 @@ case "$1" in
160160
;;
161161
esac
162162

163-
:
163+
:

0 commit comments

Comments
 (0)