8000 Add service handler for ondemand-dex by Vibe-Guy · Pull Request #270 · OSC/ood-ansible · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add service handler for ondemand-dex #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ See [auth\_openidc](https://github.com/zmartzone/mod_auth_openidc) for more info
#### Install Dex

To install dex for OIDC use set the flag `install_ondemand_dex` to true and it will install the package.
You can use the `ondemand_dex_service_state` and `ondemand_dex_service_enabled` variables in [default/main/install.yml](defaults/main/install.yml#L43) to set the state of the service (default: started / enabled).

### OnDemand.d Configurations

Expand Down
3 changes: 3 additions & 0 deletions defaults/main/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ ood_use_existing_repo_file: false
# flip this flag if you want to install the ondemand-dex RPM
install_ondemand_dex: false
ondemand_dex_package: ondemand-dex # behaviour as for ondemand_package
ondemand_dex_service_name: ondemand-dex
ondemand_dex_service_state: started
ondemand_dex_service_enabled: true

# flip this flag if you want to install the ondemand-selinux RPM
install_ondemand_selinux: false
Expand Down
8 changes: 8 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
enabled: "{{ apache_service_enabled }}"
become: true

- name: Restart ondemand-dex
ansible.builtin.systemd:
name: "{{ ondemand_dex_service_name }}"
state: "{{ 'restarted' if 'started' in ondemand_dex_service_state else omit }}" # effectively makes handler conditional on state=[re]started
enabled: "{{ ondemand_dex_service_enabled }}"
become: true
when: install_ondemand_dex

- name: Update nginx stage
ansible.builtin.command: "{{ ood_base_dir }}/nginx_stage/sbin/update_nginx_stage"
become: true
Expand Down
11 changes: 10 additions & 1 deletion tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
src: "ood_portal.yml.j2"
dest: "{{ ood_base_conf_dir }}/ood_portal.yml"
mode: 'u=rw,g=r,o='
notify: Restart apache httpd
notify:
- Restart apache httpd
- Restart ondemand-dex

- name: Template nginx_stage.yml
ansible.builtin.template:
Expand Down Expand Up @@ -98,3 +100,10 @@
name: "{{ apache_service_name }}"
state: "{{ apache_service_state }}"
enabled: "{{ apache_service_enabled }}"

- name: Start ondemand-dex service if installed
ansible.builtin.systemd:
name: "{{ ondemand_dex_service_name }}"
state: "{{ ondemand_dex_service_state }}"
enabled: "{{ ondemand_dex_service_enabled }}"
when: install_ondemand_dex
0