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

Starter site integration #226

Merged
merged 22 commits into from
Sep 22, 2022
Merged

Conversation

adam-vessey
Copy link
Contributor

@adam-vessey adam-vessey commented Sep 9, 2022

GitHub Issue:

What does this Pull Request do?

Gets the new "starter site" project installable via ansible.

What's new?

Added the starter and starter_dev profiles, with minor reworks to allow some tasks to be suppressed.

  • Does this change require documentation to be updated? Unknown.
  • Does this change add any new dependencies? No/only if using the new "starter" profile(s).
  • Does this change require any other modifications to be made to the repository
    (i.e. Regeneration activity, etc.)? No.
  • Could this change impact execution of existing code? Potentially, with how some of the ansible state had to be manipulated... it seems some things were referring to the wrong state (such as the Matomo things defining the set_search_api_config value, and "Solr" stuff still referring to it). Also, if there's other

How should this be tested?

Smoketest and compare the behaviours of the standard and demo "profiles" from before and after the changes made here, they should behave the same as they did previously.

Test out the new starter and starter_dev "profiles". Should come up and look much the same, with the only difference presently being that _dev performs a clone of the project (which is only really evident when looking at how it the project exists as it was deployed on the filesystem).

Additional Notes:

Nothing to mind...

Interested parties

Tag (@ mention) interested parties or, if unsure, @Islandora-Devops/committers

Comment on lines +24 to +63
when: webserver_app_do_original_trusted_host_and_more

- name: Trusted Host Settings
blockinfile:
state: present
block: |
$settings['trusted_host_patterns'] = array(
{% for host in drupal_trusted_hosts %}
'{{ host }}',
{% endfor %}
);
path: "{{ drupal_trusted_hosts_file }}"
marker: // {mark} ANSIBLE MANAGED BLOCK - trusted hosts
when: webserver_app_do_trusted_host

- name: Flysystem "fedora" scheme configuration
blockinfile:
state: present
block: |
$settings['flysystem'] = [
'fedora' => [
'driver' => 'fedora',
'config' => [
'root' => '{{ fedora_base_url }}',
],
],
];
path: "{{ drupal_site_default_settings }}"
marker: // {mark} ANSIBLE MANAGED BLOCK - fedora flysystem scheme
when: webserver_app_do_fedora_scheme_config

- name: Content Sync Directory configuration
blockinfile:
state: present
block: |
global $content_directories;
$content_directories['sync'] = $app_root.'/../content/sync';
path: "{{ drupal_site_default_settings }}"
marker: // {mark} ANSIBLE MANAGED BLOCK - content sync dir
when: webserver_app_do_content_sync_config
Copy link
Contributor Author

@adam-vessey adam-vessey Sep 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the best approach was here, to allow for more granular control over what was being done in what was originally called the "Trusted Host Settings" bit, which was doing more than just setting the "trusted hosts" settings... elected to keep the original, but additionally have all the bits it contained be available in separate chunks, as we don't really want the content/sync thing being done in the starter "profile".

roles/internal/webserver-app/tasks/drupal.yml Outdated Show resolved Hide resolved
Comment on lines +4 to +5
# Presently pointing at the main branch.
drupal_composer_project_package: 'islandora/islandora-starter-site:dev-main'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should eventually be pointed at whatever reference structure we move to use for releases... or maybe left without a version reference to pull whatever "latest" version?

vars/starter_dev.yml Outdated Show resolved Hide resolved
vars/starter.yml Outdated Show resolved Hide resolved
vars/starter.yml Outdated Show resolved Hide resolved
Comment on lines -9 to +14
changed_when: "'Do you want to update' in set_search_api_config.stdout"
changed_when: "'Do you want to update' in set_search_api_config_host.stdout"

- name: Set default solr server to point to first core
command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-set search_api.server.default_solr_server backend_config.connector_config.core {{ solr_cores[0] }}"
register: set_search_api_config_core
changed_when: "'Do you want to update' in set_search_api_config.stdout"
changed_when: "'Do you want to update' in set_search_api_config_core.stdout"
Copy link
Contributor Author

@adam-vessey adam-vessey Sep 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking back at https://github.com/Islandora-Devops/islandora-playbook/pull/126/files#diff-5bddb401e18178b7584b51cd9831eaa348385079b2224a85e3db8fa2412fc547L5-R15 ... I believe this is the intent, as otherwise, it seems that the set_search_api_config bit would've been being registered by the "Matomo" setup, in the webserver-app/tasks/drupal.yml bit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that seems like a typo in the Matomo stuff.

@adam-vessey adam-vessey marked this pull request as ready for review September 12, 2022 17:26
drupal_site_install_extra_args:
- '--existing-config'

openseadragon_composer_require: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these - setting up Matomo and FITS - seem like they're false only because theyre out of scope at the moment but we probably eventually want them. Can you denote/comment/group them in some way to distinguish from the others which we do/don't need due to the architecture of the Starter Site?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a shot in 52f962a ... thoughts?

Copy link
Contributor Author

@adam-vessey adam-vessey Sep 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I should mention: Anything that does need to do any configuration probably maybe shouldn't do it by config:set'ing anything, but instead to use other mechanisms such as config_override to avoid potentially dirtying configs... to avoid specific environmental concerns creeping into things; for example: If the matomo.settings:url_http value was made to dynamically point at the hostname instead of just specifying localhost:8000, then yeah, it wouldn't really belong in the config that gets used between environments where that remote would(/could) vary.

... This... does kind of get into a weird area with how the JWT stuff is presently configured, in that because things were based on the "standard" playbook install, that it just so happens to match the paths; however, if other paths are ever specified for webserver_app_jwt_key_path, then it could end up diverging...

@adam-vessey adam-vessey marked this pull request as draft September 14, 2022 16:06
Seems like Composer 2.4.2
(https://github.com/composer/composer/releases/tag/2.4.2) became more
strict, preventing the command from returning completely.
vars/starter_dev.yml Outdated Show resolved Hide resolved
@adam-vessey adam-vessey marked this pull request as ready for review September 20, 2022 16:42
@rosiel rosiel merged commit efb025e into Islandora-Devops:dev Sep 22, 2022
@adam-vessey adam-vessey deleted the feature/starter-site branch February 9, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants