You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
527 B

resource "null_resource" "cluster" {
count = "${ var.noroot ? var.servers : 0 }"
connection {
host = "${element(digitalocean_droplet.cluster.*.ipv4_address,count.index)}"
}
provisioner "remote-exec" {
inline = [
"useradd -m -s /bin/bash ec2-user",
"echo 'ec2-user ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ec2-user",
"cp -r /root/.ssh /home/ec2-user/.ssh",
"chown -R ec2-user.ec2-user /home/ec2-user/.ssh",
"chmod -R 700 /home/ec2-user/.ssh",
"rm -rf /root/.ssh"
]
}
}