---
# This playbook installs the bespoke plugins required for the site and ensures
# CKAN's configuration is correct.

- name: install packages for repos
  become: true
  apt:
    pkg: "{{ item }}"
    state: installed
  with_items:
    - libssl-dev
    - libxml2
    - libxml2-dev
    - libxslt1-dev
    - libxslt1.1
    - openssl
    - swig

- name: clone ckanext-nhsengland git repository
  become: true
  become_user: ubuntu
  git:
    repo: "{{ git_protocol }}{{ git_repos_nhse }}"
    dest: /home/ubuntu/ckanext-nhsengland
    version: upgrade-ckan

- name: run setup.py for nhsengland plugin
  become: true
  become_user: ubuntu
  command: /usr/lib/ckan/default/bin/python setup.py develop chdir=/home/ubuntu/ckanext-nhsengland

- name: clone ckanext-adfs git repository
  become: true
  become_user: ubuntu
  git:
    repo: "{{ git_protocol }}{{ git_repos_adfs }}"
    dest: /home/ubuntu/ckanext-adfs

- name: run setup.py for adfs plugin
  become: true
  become_user: ubuntu
  command: /usr/lib/ckan/default/bin/python setup.py develop chdir=/home/ubuntu/ckanext-adfs

- name: download the FederationMetadata.xml file
  get_url:
    url: "{{ ADFS_METADATA_URL }}"
    dest: "{{ ADFS_FEDERATION_METADATA_PATH }}"

---
# This playbook installs the bespoke plugins required for the site and ensures
# CKAN's configuration is correct.

- name: install packages for repos
  become: true
  apt:
    pkg: "{{ item }}"
    state: installed
  with_items:
    - libssl-dev
    - libxml2
    - libxml2-dev
    - libxslt1-dev
    - libxslt1.1
    - openssl
    - swig

- name: clone ckanext-nhsengland git repository
  become: true
  become_user: ubuntu
  git:
    repo: "{{ git_protocol }}{{ git_repos_nhse }}"
    dest: /home/ubuntu/ckanext-nhsengland

- name: run setup.py for nhsengland plugin
  become: true
  become_user: ubuntu
  command: /usr/lib/ckan/default/bin/python setup.py develop chdir=/home/ubuntu/ckanext-nhsengland

- name: clone ckanext-adfs git repository
  become: true
  become_user: ubuntu
  git:
    repo: "{{ git_protocol }}{{ git_repos_adfs }}"
    dest: /home/ubuntu/ckanext-adfs

- name: run setup.py for adfs plugin
  become: true
  become_user: ubuntu
  command: /usr/lib/ckan/default/bin/python setup.py develop chdir=/home/ubuntu/ckanext-adfs

- name: download the FederationMetadata.xml file
  get_url:
    url: "{{ ADFS_METADATA_URL }}"
    dest: "{{ ADFS_FEDERATION_METADATA_PATH }}"

Remove branch now the upgrades are merged in
Remove branch now the upgrades are merged in
