Closed IRobL closed 6 years ago
ct
converts a Container Linux Config (which is different than a cloud-config, but still yaml) into an Ignition config. The Provisioning with Container Linux Configs and Migrating from Cloud Configs documentation should help.
In this case, using
ct <<< preseed/coreos/install.yml
is redirecting the string preseed/coreos/install.yml
to ct
's standard in. To redirect the contents of the file use
ct < preseed/coreos/some_container_linux_config.yml
Thanks for the help @ajeddeloh, I hugely appreciate it! I didn't realize what tipple less than symbols actually did. Additionally somehow the 'migrating docs' didn't turn up for me natrually. What it links to, the container linux config options page is particularly useful in my migration efforts.
I think my googling for stuff like 'ignition options' and 'convert cloud-config into ignition' was what was slowing me down because I really needed to be searching for converting to container linux configuration syntax
.
I was getting other errors when using ct to transpile my cloud-config script that looked like this:
warning at line 2, column 1
Config has unrecognized key: ssh_authorized_keys
warning at line 4, column 1
Config has unrecognized key: hostname
warning at line 5, column 1
Config has unrecognized key: coreos
Here's my final container linux configuration script if this Issue googles well and is of interest to others:
passwd:
users:
- name: core
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
systemd:
units:
- name: gitlab.service
enable: true
contents: |
[Unit]
Description=gitlab server
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=0
Restart=always
ExecStartPre=-/usr/bin/mkdir -p /srv/gitlab/data/git-data/repositories
ExecStartPre=-/usr/bin/chmod 2770 /srv/gitlab/data/git-data/repositories
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
ExecStartPre=-/usr/bin/docker pull gitlab/gitlab-ce:latest
ExecStart=/usr/bin/docker run \
--name %p \
--hostname gitlab.example.com \
--publish 443:443 \
--publish 80:80 \
--publish 23:22 \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
ExecStop=/usr/bin/docker stop %p
[Install]
WantedBy=multi-user.target
- name: mail-in-a-box.service
enable: true
contents: |
[Unit]
Description=mail-in-a-box container
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=0
Restart=always
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
ExecStartPre=-/usr/bin/docker pull mtrnord/mailinabox:latest
ExecStart=/usr/bin/docker run \
--name %p \
--publish 8025:25 \
--env DOMAIN=example.com \
mtrnord/mailinabox:latest
ExecStop=/usr/bin/docker stop %p
[Install]
WantedBy=multi-user.target
- name: smail.service
enable: true
contents: |
[Unit]
Description=mail catcher
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=0
Restart=always
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
ExecStartPre=/usr/bin/docker pull schickling/mailcatcher:latest
ExecStart=/usr/bin/docker run \
-p 1080:1080 \
--name %p \
--publish 8025:25 \
schickling/mailcatcher:latest
ExecStop=/usr/bin/docker stop %p
[Install]
WantedBy=multi-user.target
Issue Report
Bug Occurrence
Reading the documentation and experimenting with converting what seems to be a cloud-config file into an ignition script is only bringing me a great sadness.
I would be grateful for the creation of a better understanding of how to convert a cloud-config file to an ignition script even for people who are new to computers.
Steps to Recreate
Example code
(install.yml)
(Vagrantfile)
(attempted conversion)