arizvisa / lolfuzz3

navs: lol.
1 stars 0 forks source link

Refactor the ignition for master.project so that all etcd units are grouped into a single target unit #3

Closed arizvisa closed 4 years ago

arizvisa commented 4 years ago

This PR refactors all of the etcd units in master.project's ignition file (composed during building) so that each unit is tied into a single etcd.target unit. Prior to this, the OnFailure= requisite was used when booting up in order to determine whether to start either the etcd-master.service or etcd-member.service unit. While provisioning master.project, the starting and stopping of the etcd service required referencing the etcd-schema.service unit directly.

As a result of this PR, when the etcd.target unit is started (or stopped), the correct service to startup is determined by the requisites of the other units. When /etc/bootstrap-environment does not exist (hasn't been created yet), the etcd-schema.service unit is started so that the etcd schema can be seeded with the initial project state.

Once both the /etc/bootstrap-environment and the /etc/network-environment files have been created, then the etcd-cluster.service unit is started. This unit will try and fetch the member list from the bootstrap server and once successful will proceed to start the etcd-member.service unit. If the bootstrap server is unavailable, the etcd.target unit will simply fall back to starting the etcd-master.service unit.