stocky-petabyte-29883
08/09/2022, 8:48 AMconst setEnvVarsCommand = new remote.Command("set-env-vars", {connection,
create: pulumi.interpolate`echo "export MASTER_USER='"test"'\nexport MASTER_PASSWORD='test'\nexport DB_USERNAME='test'\nexport DB_PASSWORD='test'\nexport DB_NAME='test'\nexport DB_HOST='test'" >> ~/.bashrc && source ~/.bashrc && echo "AcceptEnv MASTER_USER MASTER_PASSWORD DB_USERNAME DB_PASSWORD DB_NAME DB_HOST" | sudo tee -a /etc/ssh/sshd_config && sudo service sshd restart`,
delete: `head -n -6 ~/.bashrc > tmp_file && mv tmp_file ~/.bashrc && head -n -1 ~/.bashrc > tmp_sshd && sudo mv tmp_sshd /etc/ssh/sshd_config`
}, { dependsOn: remoteFile });
new remote.Command("mysql-setup-execute", {connection,
create: pulumi.interpolate`chmod 777 ./mysql-setup.sh; ./mysql-setup.sh`,
delete: "rm mysql-setup.sh",
environment: {
MASTER_USER: masterUsername,
MASTER_PASSWORD: masterPassword!,
DB_USERNAME: dbUsername,
DB_PASSWORD: dbUserPassword,
DB_NAME: dbName,
DB_HOST: dbHost
}
}, { dependsOn: setEnvVarsCommand });
I am dumping all the env variables available in the mysql-setup.sh file and the environment variables have the place holder value test.
I went with AcceptEnv as people recommended it in the issue https://github.com/pulumi/pulumi-command/issues/48
I am stuck here and need some helplittle-cartoon-10569
08/09/2022, 8:54 PM