Skip to content
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

Fixes for running provision on an existing site. #210

Merged
merged 15 commits into from
May 31, 2022
Merged
2 changes: 1 addition & 1 deletion inventory/vagrant/group_vars/crayfish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
crayfish_version_tag: dev
crayfish_version_tag: 2.x
crayfish_db: "{{ claw_db }}"

crayfish_fedora_base_url: "http://{{ hostvars[groups['tomcat'][0]].ansible_host }}:8080/fcrepo/rest"
Expand Down
1 change: 1 addition & 0 deletions inventory/vagrant/group_vars/tomcat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fcrepo_db_name: fcrepo
fcrepo_db_user: fcrepo
fcrepo_db_host: "127.0.0.1"
fcrepo_db_port: "3306"
fcrepo_db_root_password: "{{ islandora_db_root_password }}"

tomcat9_java_opts:
- -Djava.awt.headless=true
Expand Down
2 changes: 1 addition & 1 deletion post-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora.settings broker_url tcp://{{ hostvars[groups['alpaca'][0]].ansible_host }}:61613"

- name: Run migrations
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} --userid=1 mim --group=islandora"
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} --userid=1 mim islandora_tags,islandora_defaults_tags"

- name: Add vagrant user to webserver app user group
user: name={{ vagrant_user }}
Expand Down
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
version: 4.0.0

- src: geerlingguy.composer
version: 1.7.0
version: 1.9.2

- src: geerlingguy.git
version: 2.0.2
Expand Down
9 changes: 9 additions & 0 deletions roles/internal/Islandora-Devops.alpaca/tasks/compile.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
---

- name: "Get git config global safe directories dir"
shell: "git config --global --get-all safe.directory || echo ''"
register: "__git_config_global_safe_dir_alpaca"

- name: "Set Fixity source directory as git safe dir"
command: "git config --global --add safe.directory {{ alpaca_clone_directory }}"
when:
- alpaca_clone_directory not in __git_config_global_safe_dir_alpaca.stdout_lines

- name: Clone CLAW Alpaca
git:
repo: https://github.com/Islandora/Alpaca.git
Expand Down
2 changes: 1 addition & 1 deletion roles/internal/Islandora-Devops.crayfish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Available variables are listed below, along with default values:

```
# Crayfish version to install
crayfish_version_tag: 0.0.7
crayfish_version_tag: 2.x
# Crayfish services to install
crayfish_services:
- Gemini
Expand Down
5 changes: 4 additions & 1 deletion roles/internal/Islandora-Devops.crayfish/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
crayfish_version_tag: 2.0.0
crayfish_version_tag: 2.x

crayfish_services:
- Houdini
Expand Down Expand Up @@ -131,3 +131,6 @@ crayfish_recast_prefixes:
pcdmuse: "http://pcdm.org/use#"
webac: "http://fedora.info/definitions/v4/webac#"
vcard: "http://www.w3.org/2006/vcard/ns#"

webserver_app_user: "{% if ansible_os_family == 'RedHat' %}apache{% else %}www-data{% endif %}"

49 changes: 41 additions & 8 deletions roles/internal/Islandora-Devops.crayfish/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,57 @@
state: present
with_items: "{{ crayfish_packages }}"

- name: Fix Crayfish directory ownership
file:
state: directory
path: "{{ crayfish_install_dir }}"
owner: "{{ crayfish_user }}"
group: "{{ crayfish_user }}"
mode: "g+rw"
recurse: yes
force: yes
become: true

- name: Create Islandora log dir
file:
path: "{{ crayfish_log_directory }}"
state: directory
owner: "{{ crayfish_user }}"
group: "{{ crayfish_user }}"
mode: "urwx,gr,o-rwx"
recurse: yes

- name: Install crayfish code
git:
repo: https://github.com/Islandora/Crayfish.git
dest: "{{ crayfish_install_dir }}"
version: "{{ crayfish_version_tag }}"
force: yes
become_user: "{{ crayfish_user }}"
become: true

- name: "Get symfony/flex version"
composer:
command: show
working_dir: "{{ crayfish_install_dir }}/Houdini"
arguments: symfony/flex
changed_when: true
register: flex_package_info
ignore_errors: true

- name: "Delete Houdini vendor folder to update symfony/flex"
file:
state: absent
path: "{{ crayfish_install_dir }}/Houdini/vendor"
when: "'versions : * v1.13.3' in flex_package_info.stdout"

- name: Build crayfish code including dependencies
composer:
command: install
working_dir: "{{ crayfish_install_dir }}/{{ item }}"
with_items: "{{ crayfish_services }}"
become_user: "{{ crayfish_user }}"
become: true

- name: Get SSL keys
include_role:
Expand All @@ -62,14 +101,6 @@
include_tasks: "./tasks/symfony_config.yml"
with_items: "{{ crayfish_symfony_services }}"

- name: Create Islandora log dir
file:
path: "{{ crayfish_log_directory }}"
state: directory
owner: "{{ crayfish_user }}"
group: "{{ crayfish_user }}"
mode: "urwx,gr,o-rwx"

- name: Create httpd config directories
file:
path: "{{ httpd_conf_directory }}/{{ item }}/"
Expand All @@ -89,6 +120,7 @@
owner: "{{ crayfish_user }}"
group: "{{ crayfish_user }}"
with_items: "{{ crayfish_services }}"
become: yes

- name: Symlink crayfish httpd config file into action
file:
Expand All @@ -99,3 +131,4 @@
state: link
with_items: "{{ crayfish_services }}"
notify: restart apache
become: yes
2 changes: 1 addition & 1 deletion roles/internal/Islandora-Devops.crayfish/tests/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
become: yes

vars:
crayfish_version_tag: "dev"
crayfish_version_tag: "2.x"
php_version: "7.4"
php_packages_extra:
- libapache2-mod-php7.4
Expand Down
2 changes: 1 addition & 1 deletion roles/internal/Islandora-Devops.crayfish/tests/pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
become: yes

vars:
crayfish_version_tag: "dev"
crayfish_version_tag: "2.x"
php_version: "7.4"
php_packages_extra:
- libapache2-mod-php7.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"

- name: "Get git config global safe directories dir"
shell: "git config --global --get-all safe.directory || echo ''"
register: "__git_config_global_safe_dir"

- name: "Set Fixity source directory as git safe dir"
command: "git config --global --add safe.directory {{ crayfits_home }}/CrayFits"
when:
- crayfits_home + '/CrayFits' not in __git_config_global_safe_dir.stdout_lines

- name: Install FITS Microservice from Github
git:
repo: https://github.com/roblib/CrayFits.git
Expand Down
2 changes: 1 addition & 1 deletion roles/internal/Islandora-Devops.grok/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ grok_clone_directory: /opt/grok

Version to install:
```
grok_version_tag: v2.3.0
grok_version_tag: v3.1.0
```

## Dependencies
Expand Down
2 changes: 1 addition & 1 deletion roles/internal/Islandora-Devops.grok/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
grok_clone_directory: /opt/grok
grok_version_tag: v2.3.0
grok_version_tag: v3.1.0
1 change: 1 addition & 0 deletions roles/internal/Islandora-Devops.grok/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
repo: https://github.com/GrokImageCompression/grok.git
dest: "{{ grok_clone_directory }}"
version: "{{ grok_version_tag }}"
force: yes

- name: Make build directory
file:
Expand Down
5 changes: 2 additions & 3 deletions roles/internal/webserver-app/tasks/drupal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@

- name: Import features
command: "{{ drush_path }} --root {{ drupal_core_path }} -y fim islandora_core_feature,islandora_defaults"

- name: Import search feature
command: "{{ drush_path }} --root {{ drupal_core_path }} -y
fim islandora_search"
command: "{{ drush_path }} --root {{ drupal_core_path }} -y fim islandora_search"
when: islandora_profile == "standard"

# masonry library is required by content_browser and not installed by composer due to issue 2971165.
Expand Down
1 change: 1 addition & 0 deletions solr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
changed_when: false
until: files_to_copy is not failed
retries: 5
ignore_errors: yes
tags: solr

- name: Delete Log4J JNDI class from JARs
Expand Down