File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 130130 group : root
131131 mode : 0644
132132
133+ - name : Add service environment variables
134+ when : extra_service_envs is defined and extra_service_envs | length > 0
135+ ansible.builtin.lineinfile :
136+ path : " {{ systemd_dir }}/k3s.service.env"
137+ line : " {{ item }}"
138+ with_items : " {{ extra_service_envs }}"
139+
133140 - name : Enable and check K3s service
134141 ansible.builtin.systemd :
135142 name : k3s
Original file line number Diff line number Diff line change 1717 job : " /opt/yunion/bin/ocadm alpha certs renew all"
1818 cron_file : yunion_ocadm_renew_certs
1919 become : true
20+
21+ - name : Check if k3s.service.env file exists
22+ ansible.builtin.stat :
23+ path : /etc/systemd/system/k3s.service.env
24+ register : k3s_service_env_file
25+ become : true
26+
27+ - name : Add CATTLE_NEW_SIGNED_CERT_EXPIRATION_DAYS to k3s.service.env if not set
28+ ansible.builtin.lineinfile :
29+ path : /etc/systemd/system/k3s.service.env
30+ line : " CATTLE_NEW_SIGNED_CERT_EXPIRATION_DAYS=3650"
31+ regexp : " ^CATTLE_NEW_SIGNED_CERT_EXPIRATION_DAYS="
32+ state : present
33+ create : false
34+ when : k3s_service_env_file.stat.exists
35+ become : true
You can’t perform that action at this time.
0 commit comments