Skip to content

Commit

Permalink
improve cloud init timeouts (#238)
Browse files Browse the repository at this point in the history
* add cloud-init config for openstack to increase timeout

* increase timeout for cloud-init

* overwrite initd of cloud-init to allow longer startup times

* disable resizefs in cloud-init
  • Loading branch information
dergeberl authored Sep 6, 2023
1 parent fc56d53 commit 8ac8fb3
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
8 changes: 8 additions & 0 deletions image/cloud-init-10_openstack.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
datasource_list: ["OpenStack"]
datasource:
OpenStack:
# metadata_urls: ["http://169.254.169.254"]
# max_wait: -1
timeout: 15
retries: 10
# apply_network_config: True
14 changes: 14 additions & 0 deletions image/cloud-init-initd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/sbin/openrc-run
# add depends for network, dns, fs etc
depend() {
after cloud-init-local
after net
before cloud-config
provide cloud-init
keyword -timeout
}

start() {
cloud-init init
eend 0
}
22 changes: 22 additions & 0 deletions image/install-alpine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,28 @@
- name: enable keepalivedstats
command: "rc-update add keepalivedstats default"

- name: add cloud-init config
copy:
src: ./cloud-init-10_openstack.cfg
dest: /etc/cloud/cloud.cfg.d/10_openstack.cfg
owner: root
group: root
mode: 0644

- name: overwrite cloud-init initd file
copy:
src: ./cloud-init-initd
dest: /etc/init.d/cloud-init
owner: root
group: root
mode: 0755

- name: disable resizefs in cloud-init
ansible.builtin.lineinfile:
path: /etc/cloud/cloud.cfg
regexp: '^(#)?\s- resizefs.*'
line: '# - resizefs'

- name: enable cloud-config
command: "rc-update add cloud-config default"
- name: enable cloud-init-local
Expand Down

0 comments on commit 8ac8fb3

Please sign in to comment.