diff --git a/config/dir-sot.yaml b/config/dir-sot.yaml index d7b44dc..b148236 100644 --- a/config/dir-sot.yaml +++ b/config/dir-sot.yaml @@ -9,6 +9,8 @@ ServerClient: Port: 24601 InsecureSkipVerify: true SavePath: "/var/vaquero" +LocalDir: + PollInterval: 1 Etcd: Endpoints: - "http://10.10.10.5:2379" @@ -16,8 +18,6 @@ Etcd: - "http://10.10.10.7:2379" Timeout: 5 Retry: 3 -LocalDir: - PollInterval: 1 SoT: - Local: ID: vaquero-local diff --git a/local/assets/cloud-config/coreos.yml b/local/assets/cloud-config/coreos.yml index 2c8c690..e7e5791 100644 --- a/local/assets/cloud-config/coreos.yml +++ b/local/assets/cloud-config/coreos.yml @@ -1,6 +1,5 @@ #cloud-config coreos: - update: group: stable reboot-strategy: off @@ -15,6 +14,20 @@ coreos: {{ end }} units: + - name: checkpoint.service + command: start + content: | + [Unit] + Description=CoreOS (Re)Provision + Author=Vaquero + + [Service] + ExecStart=/usr/bin/curl {{ Checkpoint }} + Restart=on-failure + RestartSec=5s + [Install] + WantedBy=multi-user.target + - name: etcd2.service command: start - name: fleet.service diff --git a/local/assets/ignition/etcd-proxy.yml b/local/assets/ignition/etcd-proxy.yml index 4f5cdd2..214d7fa 100644 --- a/local/assets/ignition/etcd-proxy.yml +++ b/local/assets/ignition/etcd-proxy.yml @@ -1,6 +1,15 @@ --- systemd: units: + - name: checkpoint.service + enable: true + contents: | + [Service] + Restart=on-failure + RestartSec=5s + ExecStart=/usr/bin/curl -vvv {{ Checkpoint }} + [Install] + WantedBy=multi-user.target - name: etcd2.service enable: true dropins: diff --git a/local/assets/ignition/etcd.yml b/local/assets/ignition/etcd.yml index 9fbe644..b4d74eb 100644 --- a/local/assets/ignition/etcd.yml +++ b/local/assets/ignition/etcd.yml @@ -1,6 +1,16 @@ --- systemd: units: + - name: checkpoint.service + enable: true + contents: | + [Service] + ExecStart=/usr/bin/curl -vvv {{ Checkpoint }} + Restart=on-failure + RestartSec=5s + [Install] + WantedBy=multi-user.target + - name: etcd2.service enable: true dropins: diff --git a/local/boot/coreos-cloudconfig.yml b/local/boot/coreos-cloudconfig.yml index 725046f..f362702 100644 --- a/local/boot/coreos-cloudconfig.yml +++ b/local/boot/coreos-cloudconfig.yml @@ -10,3 +10,19 @@ unattended: metadata: root_pass: $1$De/uvwHY$77ZDxv9lNwZJbwFziq4Ix0 + +before_shutdown: + - image: busybox + pull: yes + commands: + - /bin/ls + retry: 0 + timeout: 60 + +validate: + - image: busybox + pull: yes + commands: + - "[ -e /etc ]" + retry: 0 + timeout: 60 diff --git a/local/boot/coreos-ignition-cluster.yml b/local/boot/coreos-ignition-cluster.yml index 14fb6f3..b019dd8 100644 --- a/local/boot/coreos-ignition-cluster.yml +++ b/local/boot/coreos-ignition-cluster.yml @@ -11,3 +11,19 @@ unattended: metadata: fleet_role: etcd root_pass: $1$De/uvwHY$77ZDxv9lNwZJbwFziq4Ix0 + +before_shutdown: + - image: busybox + pull: yes + commands: + - /bin/ls + retry: 0 + timeout: 60 + +validate: + - image: busybox + pull: yes + commands: + - /bin/sh -c "[ -e /etc ]" + retry: 0 + timeout: 60 diff --git a/local/sites/test-site/inventory.yml b/local/sites/test-site/inventory.yml index 1306ccb..63a6777 100644 --- a/local/sites/test-site/inventory.yml +++ b/local/sites/test-site/inventory.yml @@ -35,12 +35,12 @@ name: etcd3 interfaces: - type: physical subnet: vagrant1 + mac: 00:00:00:00:00:23 + ipv4: 10.10.10.23 bmc: type: ssh username: core keypath: /vagrant/provision_files/id_rsa - mac: 00:00:00:00:00:23 - ipv4: 10.10.10.23 metadata: mstr: etcd3 role: kube-master @@ -130,6 +130,10 @@ interfaces: subnet: vagrant1 mac: 00:00:00:00:00:41 ipv4: 10.10.10.41 + bmc: + type: ssh + username: core + keypath: /vagrant/provision_files/id_rsa metadata: name: centos1 ip: 10.10.10.41