aws userdata bugfix

This commit is contained in:
tangbin
2020-02-14 19:36:13 +08:00
parent c85a8d354e
commit 08d412669d
7 changed files with 87 additions and 36 deletions
+6 -1
View File
@@ -34,6 +34,7 @@ import (
*/
type TSudoPolicy string
type TSshPwauth string
const (
CLOUD_CONFIG_HEADER = "#cloud-config\n"
@@ -43,6 +44,10 @@ const (
USER_SUDO = TSudoPolicy("sudo")
USER_SUDO_DENY = TSudoPolicy("sudo_deny")
USER_SUDO_NONE = TSudoPolicy("")
SSH_PASSWORD_AUTH_ON = TSshPwauth("true")
SSH_PASSWORD_AUTH_OFF = TSshPwauth("false")
SSH_PASSWORD_AUTH_UNCHANGED = TSshPwauth("unchanged")
)
type SWriteFile struct {
@@ -74,7 +79,7 @@ type SCloudConfig struct {
Packages []string
PhoneHome *SPhoneHome
DisableRoot int
SshPwauth int
SshPwauth TSshPwauth
}
func NewWriteFile(path string, content string, perm string, owner string, isBase64 bool) SWriteFile {
+1 -1
View File
@@ -43,7 +43,7 @@ func TestSCloudConfig_UserData(t *testing.T) {
Url: "http://www.yunion.io/$INSTANCE_ID",
},
DisableRoot: 0,
SshPwauth: 1,
SshPwauth: SSH_PASSWORD_AUTH_ON,
}
userData := config.UserData()