Skip to content

Commit

Permalink
Merge pull request #47 from toopy/enhancements
Browse files Browse the repository at this point in the history
Add microk8s_bin_path when /snap/bin is not in the PATH
  • Loading branch information
istvano authored Mar 29, 2024
2 parents ab622f3 + 57fb5bd commit 37b884c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ add_workers_to_hostfile: false

# for setting up custom certificate request. Set to template name to enable
#microk8s_csr_template: null

# when /snap/bin is not in the PATH
microk8s_bin_path: ""
6 changes: 3 additions & 3 deletions tasks/addons.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: get current addons state
become: yes
command:
cmd: microk8s.status --format yaml
cmd: "{{ microk8s_bin_path }}microk8s.status --format yaml"
changed_when: no
register: microk8s_status
check_mode: no
Expand All @@ -16,7 +16,7 @@
loop_control:
label: "{{ item.name }}"
command:
cmd: microk8s.enable {{ item.name }}{% if microk8s_plugins[item.name] != True %}:{{ microk8s_plugins[item.name] }}{% endif %}
cmd: "{{ microk8s_bin_path }}microk8s.enable {{ item.name }}{% if microk8s_plugins[item.name] != True %}:{{ microk8s_plugins[item.name] }}{% endif %}"
when:
- item.status == 'disabled'
- item.name in microk8s_plugins
Expand All @@ -28,7 +28,7 @@
loop_control:
label: "{{ item.name }}"
command:
cmd: microk8s.disable {{ item.name }}
cmd: "{{ microk8s_bin_path }}microk8s.disable {{ item.name }}"
when:
- item.status == 'enabled'
- item.name in microk8s_plugins
Expand Down
2 changes: 1 addition & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

- name: Wait for microk8s to be ready
become: yes
command: microk8s.status --wait-ready
command: "{{ microk8s_bin_path }}microk8s.status --wait-ready"
changed_when: false
register: mk8sstatusout
failed_when:
Expand Down

0 comments on commit 37b884c

Please sign in to comment.