Skip to content

Instantly share code, notes, and snippets.

@mthenw
Created September 22, 2017 08:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mthenw/fe8c0b24876c3df3a258635617e826b8 to your computer and use it in GitHub Desktop.
Save mthenw/fe8c0b24876c3df3a258635617e826b8 to your computer and use it in GitHub Desktop.
systemd mounting and formatting
systemd:
units:
- name: format-ebs.service
command: start
contents: |
[Unit]
Description=Formats EBS /dev/xvdb volume
After=dev-xvdb.device
Requires=dev-xvdb.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/wipefs -f /dev/xvdb
ExecStart=/usr/sbin/mkfs.ext4 /dev/xvdb
- name: var-lib-etcd.mount
command: start
contents: |
[Unit]
Description=Mount EBS to /var/lib/etcd
Requires=format-ebs.service
After=format-ebs.service
[Mount]
What=/dev/xvdb
Where=/var/lib/etcd
Type=ext4
[Install]
WantedBy=multi-user.target
- name: etcd-member.service
dropins:
- name: 10-wait-etcd-member.conf
contents: |
[Unit]
After=var-lib-etcd.mount
Requires=var-lib-etcd.mount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment