Cloud-init config for centos-7
diff --git a/centos-7/configs/cloud/cloud.cfg b/centos-7/configs/cloud/cloud.cfg
new file mode 100644
index 0000000..dd84aa2
--- /dev/null
+++ b/centos-7/configs/cloud/cloud.cfg
@@ -0,0 +1,64 @@
+# If this is set, 'root' will not be able to ssh in and they
+# will get a message to login instead as the above $user (ubuntu)
+disable_root: false
+
+# This will cause the set+update hostname module to not operate (if true)
+preserve_hostname: false
+
+# Better let managing of /etc/hosts on salt and others
+# manage_etc_hosts: localhost
+
+# The modules that run in the 'init' stage
+cloud_init_modules:
+ - migrator
+ - bootcmd
+ - write-files
+ - growpart
+ - resizefs
+ - set_hostname
+ - update_hostname
+ - update_etc_hosts
+ - rsyslog
+ - users-groups
+ - ssh
+
+# The modules that run in the 'config' stage
+cloud_config_modules:
+ - mounts
+ - locale
+ - set-passwords
+ - yum-add-repo
+ - package-update-upgrade-install
+ - timezone
+ - puppet
+ - chef
+ - salt-minion
+ - mcollective
+ - disable-ec2-metadata
+ - runcmd
+
+# The modules that run in the 'final' stage
+cloud_final_modules:
+ - rightscale_userdata
+ - scripts-per-once
+ - scripts-per-boot
+ - scripts-per-instance
+ - scripts-user
+ - ssh-authkey-fingerprints
+ - keys-to-console
+ - phone-home
+ - final-message
+
+datasource:
+ Ec2:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+ OpenStack:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+
+growpart:
+ mode: auto
+ devices: ['/']
+
+# vim: syntax=yaml
diff --git a/centos-7/scripts/security.sh b/centos-7/scripts/security.sh
index 2f99ca8..29e04ce 100644
--- a/centos-7/scripts/security.sh
+++ b/centos-7/scripts/security.sh
@@ -48,7 +48,3 @@
# Disable SSH password authentication and permit root login
sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|[#]*PermitRootLogin .*|PermitRootLogin yes|g' /etc/ssh/sshd_config
-
-echo > /root/.ssh/authorized_keys
-deluser centos
-rm -rf /home/centos || true
diff --git a/centos-7/template.json b/centos-7/template.json
index 9f381ba..1f7fa8e 100644
--- a/centos-7/template.json
+++ b/centos-7/template.json
@@ -50,6 +50,16 @@
]
}
}
+ },
+ {
+ "type": "file",
+ "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg",
+ "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
+ },
+ {
+ "type": "file",
+ "source": "configs/cloud/cloud.cfg",
+ "destination": "/etc/cloud/cloud.cfg"
}
],
"post-processors": [