Skip to content

Instantly share code, notes, and snippets.

@lolozere
Created December 27, 2016 18:34
Show Gist options
  • Save lolozere/fdad1d2c739ad4727e6ee48e0c0b7959 to your computer and use it in GitHub Desktop.
Save lolozere/fdad1d2c739ad4727e6ee48e0c0b7959 to your computer and use it in GitHub Desktop.
#cloud-config
ssh_authorized_keys:
- "my ssh-rsa"
hostname: coreos.local
users:
- name: "coreuser"
passwd: "$6$rounds=4096$0mW3HEucK3tw$bs3AkEqFTc2w/yng/EodCpkWcXN6goj.Uj6NBgh805uSFZgvBDT4rTtAnXgpbuglDM9Nx9kFIyedJv4Ow3zb31"
groups:
- "sudo"
- "docker"
ssh-authorized-keys:
- "my ssh-rsa"
write_files:
- path: /etc/sysctl.d/libresh.conf
permissions: 0644
owner: root
content: |
fs.aio-max-nr=1048576
vm.max_map_count=262144
- path: /etc/hosts
permissions: 0644
owner: root
content: |
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
- path: /etc/environment
permission: 0644
owner: root
content: |
NAMECHEAP_URL="namecheap.com"
NAMECHEAP_API_USER="lolozere"
NAMECHEAP_API_KEY=
IP=`curl -s http://icanhazip.com/`
FirstName="Laurent"
LastName="Chedanne"
Address=""
PostalCode=""
Country="France"
Phone="+33.623482721"
EmailAddress="laurent@chedanne.pro"
City="Grenoble"
CountryCode="FR"
BACKUP_DESTINATION=root@xxxxx:port
MAIL_USER=postmaster@chedanne.pro
MAIL_PASS=dEi8RmQ67
MAIL_HOST=ssl0.ovh.net
MAIL_PORT=465
coreos:
update:
reboot-strategy: off
units:
- name: systemd-sysctl.service
command: restart
- name: swap.service
enable: true
command: start
content: |
[Unit]
Description=Turn on swap
[Service]
Type=oneshot
RemainAfterExit=true
ExecStartPre=-/bin/bash -euxc ' \
fallocate -l 512m /swap &&\
chmod 600 /swap &&\
mkswap /swap'
ExecStart=/sbin/swapon /swap
ExecStop=/sbin/swapoff /swap
[Install]
WantedBy=local.target
- name: install-compose.service
command: start
content: |
[Unit]
Description=Install Docker Compose
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/bash -euxc ' \
mkdir -p /opt/bin &&\
url=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r \'.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))\') &&\
curl -L $url > /opt/bin/docker-compose &&\
chmod +x /opt/bin/docker-compose'
- name: install-libresh.service
command: start
content: |
[Unit]
Description=Install libre.sh
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/bash -euxc ' \
git clone https://github.com/indiehosters/libre.sh.git /libre.sh &&\
mkdir /{data,system} &&\
mkdir /data/trash &&\
cp /libre.sh/unit-files/* /etc/systemd/system && systemctl daemon-reload &&\
systemctl enable web-net.service &&\
systemctl start web-net.service &&\
cp /libre.sh/utils/* /opt/bin/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment