Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jkmart/8c4e5a238e787dde7a8350668986c3b2 to your computer and use it in GitHub Desktop.
Save jkmart/8c4e5a238e787dde7a8350668986c3b2 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