Skip to content

Commit

Permalink
Fix: get simplesamlphp via tarball so later versions work; bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontalvo3 committed Oct 13, 2021
1 parent 1780b6f commit f680a39
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
4 changes: 4 additions & 0 deletions config/core/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ m_parsoid_version: "tags/v0.10.0"
# MediaWiki 1.29 and higher require ElasticSearch 5.x
elasticsearch_major_version: "5.x"

# SAML
simplesamlphp_version: "1.18.8"
saml_mw_extension_version: "master"

#
# NOTIFICATIONS
#
Expand Down
52 changes: 33 additions & 19 deletions src/roles/saml/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
path: "{{ m_simplesamlphp_path }}"
register: simplesamlphp_exists

- name: "Check if {{ m_simplesamlphp_path }} exists"
- name: "Check if SAML MW extension exists"
stat:
path: "{{ m_mediawiki }}/extensions/SimpleSamlAuth"
register: simplesamlextension_exists
Expand All @@ -27,19 +27,40 @@
recurse: yes
when: simplesamlphp_exists.stat.exists and simplesamlphp_exists.stat.isdir

- name: Ensure SimpleSamlPhp (PHP SAML library) installed
- name: Get simplesamlphp tarball
become: yes
become_user: "meza-ansible"
# Ref #1149 for TMPDIR environment var
environment:
TMPDIR: "{{ m_tmp }}"
git:
repo: https://github.com/simplesamlphp/simplesamlphp.git
get_url:
url: "https://github.com/simplesamlphp/simplesamlphp/releases/download/v{{ simplesamlphp_version }}/simplesamlphp-{{ simplesamlphp_version }}.tar.gz"
dest: "{{ m_home }}/meza-ansible/"
register: new_simplesamlphp_archive

- name: Remove simplesamlphp directory if new version available
file:
path: "{{ m_simplesamlphp_path }}"
state: absent

- name: "Create empty directory for {{ m_simplesamlphp_path }} if installing new version"
file:
path: "{{ m_simplesamlphp_path }}"
state: directory
owner: "{{ m_simplesamlphp_owner }}"
group: "{{ m_simplesamlphp_group }}"
mode: "{{ m_simplesamlphp_mode }}"

- name: Unarchive simplesamlphp tarball if new
become: yes
become_user: "meza-ansible"
unarchive:
src: "{{ m_home }}/meza-ansible/simplesamlphp-{{ simplesamlphp_version }}.tar.gz"
dest: "{{ m_simplesamlphp_path }}"
version: "tags/v1.16.1"
umask: "0002"
tags:
- latest
owner: "{{ m_simplesamlphp_owner }}"
group: "{{ m_simplesamlphp_group }}"
mode: "{{ m_simplesamlphp_mode }}"
remote_src: yes
extra_opts:
- "--strip-components=1"
when: new_simplesamlphp_archive.changed

- name: Ensure SimpleSamlAuth (MediaWiki extension) installed
become: yes
Expand All @@ -53,18 +74,11 @@
# until meza switches to Cicalese's Extension:SimpleSamlPhp.
repo: https://github.com/jamesmontalvo3/mwSimpleSamlAuth.git
dest: "{{ m_mediawiki }}/extensions/SimpleSamlAuth"
version: master
version: "{{ saml_mw_extension_version }}"
umask: "0002"
tags:
- latest

- name: Ensure simplesamlphp dependencies in place
become: yes
become_user: "meza-ansible"
composer:
command: install
working_dir: "{{ m_simplesamlphp_path }}"

- name: Ensure config files in place
template:
src: "{{ item.filename }}.j2"
Expand Down
2 changes: 1 addition & 1 deletion src/roles/saml/templates/SAMLConfig.php.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ $wgSamlRealnameAttr = '{{ saml_public.idp_realname_attr }}';
$wgSamlMailAttr = '{{ saml_public.idp_email_attr }}';

// SimpleSamlPhp settings
$wgSamlSspRoot = '/opt/simplesamlphp';
$wgSamlSspRoot = '{{ m_install }}/simplesamlphp';
$wgSamlAuthSource = 'default-sp';
$wgSamlPostLogoutRedirect = NULL;

0 comments on commit f680a39

Please sign in to comment.