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

Idempotence fix for /etc/systemd/system/tomcat9.service.d/override.conf #256

Open
RodBruce opened this issue Feb 5, 2023 · 0 comments
Open
Assignees

Comments

@RodBruce
Copy link

RodBruce commented Feb 5, 2023

When I try to run the playbook against an existing site running on Ubuntu 20.04 it hangs at the task:
"Wait for Blazegraph to come up" which is in the file:
roles/internal/Islandora-Devops.blazegraph/tasks/namespace.yml

What is happening here is that Tomcat isn't starting cleanly.

The problem is the way the file:
/etc/systemd/system/tomcat9.service.d/override.conf

Is getting added and modified in the file:
roles/internal/Islandora-Devops.tomcat/tasks/install-Debian.yml

I changed it so if the file is already there it won't overwrite it and will only add lines if they are not already there.

After I made the change I can run the playbook against an installed site and it works for me.

Here is a diff of my changes:

diff install-Debian.yml.save install-Debian.yml
24,29c24,28
< - name: Create file with sandbox overrides
<   copy:
<     dest: "/etc/systemd/system/tomcat9.service.d/override.conf"
<     content: |
<       [Service]
<       ReadWritePaths={{ blazegraph_home_dir }}/data/
---
> - name: Create a file for sandbox overrides
>   ansible.builtin.lineinfile:
>     path: "/etc/systemd/system/tomcat9.service.d/override.conf"
>     line: "[Service]"
>     create: yes
30a30,36
> 
> - name: Add Blazegraph ReadWritePaths to sandbox overrides
>   ansible.builtin.lineinfile:
>     path: "/etc/systemd/system/tomcat9.service.d/override.conf"
>     regex: "^ReadWritePaths={{ blazegraph_home_dir }}/data/$"
>     line: "ReadWritePaths={{ blazegraph_home_dir }}/data/"
>     insertafter: "[Service]"

Thanks

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

No branches or pull requests

3 participants