Skip to content

Instantly share code, notes, and snippets.

@tomlanyon
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomlanyon/ce531c0fa4ce819d2032 to your computer and use it in GitHub Desktop.
Save tomlanyon/ce531c0fa4ce819d2032 to your computer and use it in GitHub Desktop.
salt-cloud error

Trying to follow the example in http://docs.saltstack.com/en/latest/topics/cloud/map.html#setting-up-new-salt-masters

If I remove 'make_master: True' from the salt instance, the command executes successfully.

$ cat /etc/salt/cloud.maps.d/test.map
ec2_ubuntu:
  - salt:
    make_master: True
  - web1
  - web2
  - db
$ sudo salt-cloud -m /etc/salt/cloud.maps.d/test.map -Q
[INFO    ] salt-cloud starting
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
AttributeError: 'bool' object has no attribute 'setdefault'
Traceback (most recent call last):
  File "/usr/bin/salt-cloud", line 10, in <module>
    salt_cloud()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 319, in salt_cloud
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cloud/cli.py", line 87, in run
    mapper = salt.cloud.Map(self.config)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1540, in __init__
    self.rendered_map = self.read()
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1670, in read
    overrides.setdefault('name', name)
AttributeError: 'bool' object has no attribute 'setdefault'
Traceback (most recent call last):
  File "/usr/bin/salt-cloud", line 10, in <module>
    salt_cloud()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 319, in salt_cloud
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cloud/cli.py", line 87, in run
    mapper = salt.cloud.Map(self.config)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1540, in __init__
    self.rendered_map = self.read()
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1670, in read
    overrides.setdefault('name', name)
AttributeError: 'bool' object has no attribute 'setdefault'
$ sudo sed -i'' -e '/make_master/d' /etc/salt/cloud.maps.d/test.map
$ sudo salt-cloud -m /etc/salt/cloud.maps.d/test.map -Q
[INFO    ] salt-cloud starting
[INFO    ] Applying map from '/etc/salt/cloud.maps.d/test.map'.
[INFO    ] Starting new HTTPS connection (1): ec2.ap-southeast-2.amazonaws.com
my-ec2:
    ----------
    ec2:
        ----------
        db:
            Absent
        salt:
            Absent
        web1:
            Absent
        web2:
            Absent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment