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

Fixing issue with doryd service not coming up #586

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
31 changes: 31 additions & 0 deletions ansible_3par_docker_plugin/tasks/configure_doryd_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,34 @@
daemon_reload: yes
enabled: yes
name: doryd.service

- name: collect facts about system services
service_facts:
register: services_state

- name: If the service failed to start, use another kubeconfig
ini_file:
path: /etc/systemd/system/doryd.service
section: Service
option: ExecStart
value: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/hpe.com~hpe/doryd /etc/origin/master/admin.kubeconfig hpe.com
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stopgap fix. The long term fix would be to understand which config file works for which version of openshift/kubernetes

when: services_state['ansible_facts']['services']['doryd.service']['state'] == "stopped"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can there be a possible race condition between the two attempts to start the service?
E.g. the admin.conf, is good and the service is about to come up but the state is still "stopped" so the attempt to start service with admin.kubeconfig is also made. Is some sleep or wait required between the two attempts? Please check.


- name: restart doryd service, also issue daemon-reload to pick up config changes
systemd:
state: started
daemon_reload: yes
enabled: yes
name: doryd.service
when: services_state['ansible_facts']['services']['doryd.service']['state'] == "stopped"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to check against started rather than stopped


- name: Getting the status of the service
service_facts:
register: services_state_2
when: services_state['ansible_facts']['services']['doryd.service']['state'] == "stopped"

- name: Fail if the service fails to start
fail:
msg: "Failed to start doryd service"
when: services_state['ansible_facts']['services']['doryd.service']['state'] == "stopped" and services_state_2['ansible_facts']['services']['doryd.service']['state'] == "stopped"