Esempio n. 1
0
        public async Task Run()
        {
            //var devopInfraToken = await helper.Ask(DevopInfraToken);

            var apikey = await listAsk.InfraApiKey.Ask();

            var webServerRootPassword = await listAsk.WebServerRootPassword.Ask();

            var webServerUser = await listAsk.WebServerAdminUser.Ask();

            var webServerPassword = await listAsk.WebServerAdminPassword.Ask();



            infrastructure.CreateVm(apikey, "webServer", webServerRootPassword, webServerUser, webServerPassword);
            var uri             = infrastructure.GetVmSshUri(apikey, "webServer");
            var webServerSshUri = uri.ToString();


            //IAuthenticationInfo tokenAuthenticationInfo = new TokenAuthenticationInfo(devopInfraToken);
            IAuthenticationInfo auth = new UserPasswordAuthenticationInfo(
                await listAsk.LocalVaultDevopUser.Ask(),
                await listAsk.LocalVaultDevopPassword.Ask());


            await listResources.InfrastructureApiKey.Write(auth, apikey);

            await listResources.WebServerRootPassword.Write(auth, webServerRootPassword);

            await listResources.WebServerUser.Write(auth, webServerUser);

            await listResources.WebServerPassword.Write(auth, webServerPassword);

            await listResources.WebServerSshUri.Write(auth, webServerSshUri);
        }
Esempio n. 2
0
        public static SshConnection GetVmSshConnection(this IInfrastructure infrastructure, string key, string vmName, string user, string password)
        {
            var sshUri = infrastructure.GetVmSshUri(key, vmName);

            return(new SshConnection()
            {
                SshUri = sshUri,
                User = user,
                Password = password
            });
        }