Last active
June 8, 2021 00:47
-
-
Save xavierchanth/34eaaa79e3b8645b9e8e816491128059 to your computer and use it in GitHub Desktop.
CoreOS Dev Butane Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| variant: fcos | |
| version: 1.3.0 | |
| passwd: | |
| users: | |
| - name: core | |
| password_hash: PASSWORD_PLACEHOLDER | |
| - name: root | |
| groups: | |
| - docker | |
| - wheel | |
| password_hash: PASSWORD_PLACEHOLDER | |
| storage: | |
| files: | |
| - path: /etc/ssh/sshd_config.d/20-enable-passwords.conf | |
| mode: 0644 | |
| contents: | |
| inline: | | |
| PasswordAuthentication yes | |
| - path: /etc/NetworkManager/system-connections/ens2.nmconnection | |
| mode: 0600 | |
| contents: | |
| inline: | | |
| [connection] | |
| id=ens2 | |
| type=ethernet | |
| interface-name=ens2 | |
| [ipv4] | |
| address1=10.0.3.100/24,10.0.3.1 | |
| dns=10.0.3.1; | |
| dns-search= | |
| may-fail=false | |
| method=manual | |
| - path: /etc/sysctl.d/20-silence-audit.conf | |
| mode: 0644 | |
| contents: | |
| inline: | | |
| kernel.printk=4 | |
| - path: /etc/profile.d/systemd-pager.sh | |
| mode: 0644 | |
| contents: | |
| inline: | | |
| # Tell systemd to not use a pager when printing information | |
| export SYSTEMD_PAGER=cat | |
| - path: /etc/hostname | |
| mode: 0644 | |
| contents: | |
| inline: | | |
| docker-base | |
| - path: /etc/hosts | |
| mode: 0644 | |
| contents: | |
| inline: | | |
| 127.0.0.1 localhost | |
| ::1 localhost ip6-localhost ip6-loopback | |
| ff02::1 ip6-allnodes | |
| ff02::2 ip6-allrouters | |
| 10.0.3.100 docker-base |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # NOTE: This installation is not suited for production | |
| # It was written to make coreos installations easier on my homelab | |
| exit 0; | |
| nmcli | |
| curl -fsSLO <coreos-butane-dev.yaml RAW URL> | |
| sed -i "s@PASSWORD_PLACEHOLDER@$(openssl passwd -1)@g" coreos-butane-dev.yaml | |
| vi coreos-butane-dev.yaml | |
| sudo docker run -i --rm quay.io/coreos/butane:release --strict < coreos-butane-dev.yaml > coreos-dev.ign | |
| # INSTALL | |
| sudo coreos-installer install /dev/sda --ignition-file coreos-dev.ign |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo rpm-ostree install docker-compose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Set the hostname from the first param | |
| oldhost=$(cat /etc/hostname) | |
| newhost=$1 | |
| newhostid=$2 | |
| if [ -z "$1" ] | |
| then | |
| echo "New hostname: " | |
| read newhost | |
| fi | |
| if [ -z "$2" ] | |
| then | |
| echo "New host id: " | |
| read newhostid | |
| fi | |
| sudo sed -i "s/$oldhost//g" /etc/hosts | |
| sudo sed -i "s/localhost/$newhost localhost/g" /etc/hosts | |
| sudo sed -i "s/$oldhost/$newhost/g" /etc/hostname | |
| sudo sed -i "s/10.0.3.100/10.0.3.$newhostid/g" /etc/NetworkManager/system-connections/ens2.nmconnection | |
| read -s -n 1 p "Press any key to reboot" | |
| sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment