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

Ensure crio service state #6753

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions roles/container-engine/cri-o/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: check if fedora coreos
stat:
path: /run/ostree-booted
Expand All @@ -9,7 +8,6 @@
set_fact:
is_ostree: "{{ ostree.stat.exists }}"


- name: gather os specific variables
include_vars: "{{ item }}"
with_first_found:
Expand Down Expand Up @@ -46,7 +44,6 @@
state: present
when: not is_ostree
with_items: "{{ crio_packages }}"
notify: restart crio
register: package_install
until: package_install is succeeded
retries: 4
Expand Down Expand Up @@ -99,6 +96,7 @@
template:
src: crio.conf.j2
dest: /etc/crio/crio.conf
notify: restart crio

- name: Copy mounts.conf
copy:
Expand All @@ -125,10 +123,24 @@
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "7"


- name: Write cri-o proxy drop-in
template:
src: http-proxy.conf.j2
dest: /etc/systemd/system/crio.service.d/http-proxy.conf
notify: restart crio
when: http_proxy is defined or https_proxy is defined

- name: Ensure crio service is started and enabled
service:
name: crio
daemon_reload: true
enabled: true
state: started
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you think it is needed here again? there is already a handler for

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I had a special case with crio installed but stopped. The role does not handle that case. The docker role has a similar task

Copy link
Contributor

Choose a reason for hiding this comment

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

true, if nothing changes but crio is stopped


- name: Verify that crio is running
command: "crio-status info"
register: get_crio_info
until: get_crio_info is succeeded
changed_when: false
retries: 5
delay: "{{ retry_stagger | random + 3 }}"