I am trying to configure EC2 instances using stable AMI CoreOS with some configurable cloud-init configurations, but with some problems.
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"
Cloud-config above works fine, but as soon as I use below cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
users:
- name: core
coreos-ssh-import-github: oba11
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"
or
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
users:
- name: oba11
groups:
- sudo
- docker
coreos-ssh-import-github: oba11
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"
I can no longer use SSH for coreos instances as the "primary" user using my aws key pair or private key and created a custom "oba11" with my private key. I also tried alpha AMI, but the same problem. I do not know that I am doing something wrong.
Thank you very much for your help.
source
share