Maciej
Maciej

Reputation: 106

Saltstack fails when creating minions from a map file on DigitalOcean

I can't create a minion from the map file, no idea what's happened. A month ago my script was working correctly, right now it fails. I was trying to do some research about it but I could't find anything about it. Could someone have a look on my DEBUG log? The minion is created on DigitalOcean but the master server can't connect to it at all.

so I run: salt-cloud -P -m /etc/salt/cloud.maps.d/production.map -l debug

The master is running on Ubuntu 16.04.1 x64, the minion also. I use the latest saltstack's library: echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest xenial main" >> /etc/apt/sources.list.d/saltstack.list

I tested both 2016.3.2 and 2016.3.3, what is interesting, the same script was working correctly 4 weeks ago, I assume something had to change.

ERROR:

Writing /usr/lib/python2.7/dist-packages/salt-2016.3.3.egg-info
 *  INFO: Running install_ubuntu_git_post()
disabled
Created symlink from /etc/systemd/system/multi-user.target.wants/salt-minion.service to /lib/systemd/system/salt-minion.service.
 *  INFO: Running install_ubuntu_check_services()
 *  INFO: Running install_ubuntu_restart_daemons()
Job for salt-minion.service failed because a configured resource limit was exceeded. See "systemctl status salt-minion.service" and "journalctl -xe" for details.
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
 * ERROR: No init.d support for salt-minion was found
 * ERROR: Fai
[DEBUG   ] led to run install_ubuntu_restart_daemons()!!!
[ERROR   ] Failed to deploy 'minion-zk-0'. Error: Command 'ssh -t -t -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oControlPath=none -oPasswordAuthentication=no -oChallengeResponseAuthentication=no -oPubkeyAuthentication=yes -oIdentitiesOnly=yes -oKbdInteractiveAuthentication=no -i /etc/salt/keys/cloud/do.pem -p 22 root@REMOVED_IP '/tmp/.saltcloud-5d18c002-e817-46d5-9fb2-d3bdb2dfe7fd/deploy.sh -c '"'"'/tmp/.saltcloud-5d18c002-e817-46d5-9fb2-d3bdb2dfe7fd'"'"' -P git v2016.3.3'' failed. Exit code: 1
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 2293, in create_multiprocessing
    local_master=parallel_data['local_master']
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1281, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/digital_ocean.py", line 481, in create
    ret = __utils__['cloud.bootstrap'](vm_, __opts__)
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 527, in bootstrap
    deployed = deploy_script(**deploy_kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 1516, in deploy_script
    if root_cmd(deploy_command, tty, sudo, **ssh_kwargs) != 0:
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 2167, in root_cmd
    retcode = _exec_ssh_cmd(cmd, allow_failure=allow_failure, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 1784, in _exec_ssh_cmd
    cmd, proc.exitstatus
SaltCloudSystemExit: Command 'ssh -t -t -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oControlPath=none -oPasswordAuthentication=no -oChallengeResponseAuthentication=no -oPubkeyAuthentication=yes -oIdentitiesOnly=yes -oKbdInteractiveAuthentication=no -i /etc/salt/keys/cloud/do.pem -p 22 root@REMOVED_ID '/tmp/.saltcloud-5d18c002-e817-46d5-9fb2-d3bdb2dfe7fd/deploy.sh -c '"'"'/tmp/.saltcloud-5d18c002-e817-46d5-9fb2-d3bdb2dfe7fd'"'"' -P git v2016.3.3'' failed. Exit code: 1
[DEBUG   ] LazyLoaded nested.output
minion-zk-0:
    ----------
    Error:
        Command 'ssh -t -t -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oControlPath=none -oPasswordAuthentication=no -oChallengeResponseAuthentication=no -oPubkeyAuthentication=yes -oIdentitiesOnly=yes -oKbdInteractiveAuthentication=no -i /etc/salt/keys/cloud/do.pem -p 22 root@REMOVED_IP '/tmp/.saltcloud-5d18c002-e817-46d5-9fb2-d3bdb2dfe7fd/deploy.sh -c '"'"'/tmp/.saltcloud-5d18c002-e817-46d5-9fb2-d3bdb2dfe7fd'"'"' -P git v2016.3.3'' failed. Exit code: 1
root@master-zk:/etc/salt/cloud.maps.d# salt '*' test.ping
minion-zk-0:
    Minion did not return. [No response]
root@master-zk:/etc/salt/cloud.maps.d#

Upvotes: 0

Views: 660

Answers (1)

dahrens
dahrens

Reputation: 3959

It is located in your cloud configuration somewhere in /etc/salt/cloud.profiles.d/, /etc/salt/cloud.providers.d/ or /etc/salt/cloud.d/. Just figure out where and change the value salt to your masters ip.

I currently do this in my providers setting like that:

hit-vcenter:
  driver: vmware
  user: 'foo'
  password: 'secret'
  url: 'some url'
  protocol: 'https'
  port: 443
  minion:
    master: 10.1.10.1

Upvotes: 1

Related Questions