forked from techno-tim/k3s-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transition to k3s installation and uninstall scripts
closes techno-tim#108
- Loading branch information
Showing
9 changed files
with
55 additions
and
232 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
--- | ||
|
||
- name: Copy K3s service file | ||
template: | ||
src: "k3s.service.j2" | ||
dest: "{{ systemd_dir }}/k3s-node.service" | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
- name: Download install script | ||
ansible.builtin.get_url: | ||
url: https://get.k3s.io | ||
dest: "{{ ansible_user_dir }}/install_k3s.sh" | ||
mode: 744 | ||
|
||
- name: Enable and check K3s service | ||
systemd: | ||
name: k3s-node | ||
daemon_reload: yes | ||
state: restarted | ||
enabled: yes | ||
- name: Install k3s | ||
command: | ||
cmd: "./install_k3s.sh {{ extra_agent_args | default('') }}" | ||
creates: "{{ systemd_dir }}/k3s.service" | ||
environment: | ||
INSTALL_K3S_VERSION: "{{ k3s_version }}" | ||
K3S_TOKEN: "{{ k3s_token }}" | ||
K3S_URL: https://{{ apiserver_endpoint | ansible.utils.ipwrap }}:6443 | ||
|
||
- name: Ensure k3s is in a running state | ||
service: | ||
name: k3s-agent | ||
state: started | ||
register: k3sAgentServiceDetails | ||
until: k3sAgentServiceDetails.status.ActiveState == "active" | ||
retries: 20 | ||
delay: 10 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters