Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[salt-cloud][AzureARM] ssh_password not working #56152

Closed
tkykm opened this issue Feb 13, 2020 · 6 comments
Closed

[salt-cloud][AzureARM] ssh_password not working #56152

tkykm opened this issue Feb 13, 2020 · 6 comments
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged Salt-Cloud
Milestone

Comments

@tkykm
Copy link

tkykm commented Feb 13, 2020

Description of Issue

Salt Cloud|AzureARM Compute CloudError has occurred: 'adminPassword' is missing (null)

Salt-cloud fail to create linux vm to azure unless disable_password_authentication: True
And password won't be set even if I put ssh_password and disable_password_authentication: True
We can use key authentication instead but it would be better to fix this.

This is similar issue: #54767

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

profile:

centos7:
  provider: azure
  image: 'OpenLogic|CentOS|7.5|latest'
  size: Standard_DS1_v2
  ssh_username: centos
  ssh_password: 'Str0ongP@ssword'
  disable_password_authentication: True
  ssh_keyfile: /etc/salt/.ssh/key
  ssh_publickeyfile: /etc/salt/.ssh/key.pub
  network: vnet
  subnet: default
  allocate_public_ip: true

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

If disable_password_authentication: False

[ERROR   ] An AzureARM Compute CloudError has occurred: Required parameter 'adminPassword' is missing (null).
[ERROR   ] Error creating VM centos7! ({})
[ERROR   ] Failed to deploy 'centos7'. Error: Error creating VM centos7! ({})

If disable_password_authentication: True and defined ssh_password
There is no password

[centos@centos7 ~]$ sudo cat /etc/shadow
root:*LOCK*:14600::::::
bin:*:17632:0:99999:7:::
daemon:*:17632:0:99999:7:::
adm:*:17632:0:99999:7:::
lp:*:17632:0:99999:7:::
sync:*:17632:0:99999:7:::
shutdown:*:17632:0:99999:7:::
halt:*:17632:0:99999:7:::
mail:*:17632:0:99999:7:::
operator:*:17632:0:99999:7:::
games:*:17632:0:99999:7:::
ftp:*:17632:0:99999:7:::
nobody:*:17632:0:99999:7:::
systemd-network:!!:17758::::::
dbus:!!:17758::::::
polkitd:!!:17758::::::
libstoragemgmt:!!:17758::::::
sshd:!!:17758::::::
abrt:!!:17758::::::
rpc:!!:17758:0:99999:7:::
postfix:!!:17758::::::
ntp:!!:17758::::::
chrony:!!:17758::::::
tcpdump:!!:17758::::::
centos:!!:18305:0:99999:7:::

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
I've used this pip modules:
https://raw.githubusercontent.com/saltstack/salt/v2019.2.2/requirements/static/py3.6/cloud.txt

Salt Version:
Salt: 2019.2.2

Dependency Versions:
cffi: 1.13.2
cherrypy: Not Installed
dateutil: 2.8.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8.1
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.35.2
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.19
pycrypto: Not Installed
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.6.8 (default, Aug 7 2019, 17:28:10)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.4.2
ZMQ: 4.1.4

System Versions:
dist: centos 7.7.1908 Core
locale: ANSI_X3.4-1968
machine: x86_64
release: 3.10.0-514.10.2.el7.x86_64
system: Linux
version: CentOS Linux 7.7.1908 Core

@DmitryKuzmenko DmitryKuzmenko added Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged team-cloud labels Feb 14, 2020
@DmitryKuzmenko DmitryKuzmenko added this to the Blocked milestone Feb 14, 2020
@stale
Copy link

stale bot commented Mar 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Mar 15, 2020
@nicholasmhughes
Copy link
Collaborator

What's the intended operation here? Use both a password and an ssh key?

@stale
Copy link

stale bot commented Mar 16, 2020

Thank you for updating this issue. It is no longer marked as stale.

@stale stale bot removed the stale label Mar 16, 2020
@tkykm
Copy link
Author

tkykm commented Mar 19, 2020

Mainly I want to use password authentication. But both is also nice

@nicholasmhughes
Copy link
Collaborator

Ok. Right now, we don't have the ability to pass both a password and an ssh key. We can keep this issue open as a feature request for that functionality.

In the meantime... if you want to use a password, you need to stop sending a public key file:

centos7:                                                                                                                
  provider: azure                                                                                              
  image: 'OpenLogic|CentOS|7.5|latest'                                                                                  
  size: Standard_B1s                                                                                                    
  ssh_username: centos                                                                                                  
  ssh_password: 'Str0ongP@ssword'                                                                                       
  disable_password_authentication: False                                                                                
  #  ssh_publickeyfile: /etc/salt/salt.pub                                                                                
  resource_group: test                                                                                                  
  network: vnet                                                                                                         
  subnet: default                                                                                                       
  allocate_public_ip: True

@nicholasmhughes
Copy link
Collaborator

The Azure functionality in Salt is moving to https://github.com/salt-extensions/saltext-azurerm

I have opened an issue there to represent the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged Salt-Cloud
Projects
None yet
Development

No branches or pull requests

4 participants