bluethundr
bluethundr

Reputation: 1325

create VPC in salt using boto.vpc

I’m pretty close to having a vpc created I think. I’m running into an error applying it. It may have to do with an outdated boto module in python.

This is what I get when I try to apply the state:

[root@salt dlab]# salt '*' state.apply

salt.localdomain:

----------

          ID: Ensure VPC exists

    Function: boto_vpc.present

        Name: myvpc

      Result: False

     Comment: State 'boto_vpc.present' was not found in SLS 'vpc'

              Reason: 'boto_vpc' __virtual__ returned False

     Changes:

Summary for salt.localdomain

------------

Succeeded: 0

Failed:    1

------------

Total states run:     1

Total run time:   0.000 ms

ERROR: Minions returned with non-zero exit code

I can see the module with the show_top command:

[root@salt ~]# salt '*' state.show_top

salt.localdomain:

    ----------

    dlab:

        - vpc

This is what I have in my top file:

[root@salt ~]# cat /srv/salt/dlab/top.sls

dlab:

  '*':

    - vpc

And this is all I have in my init:

[root@salt ~]# cat /srv/salt/dlab/vpc/init.sls

  Ensure VPC exists:

    boto_vpc.present:

        - name: myvpc

        - cidr_block: 10.10.11.0/24

        - dns_hostnames: True

        - region: us-east-1

        - keyid: removed

        - key: removed

Again, the reason for the error may be due to an old boto library. This is the version that I have:

[root@salt ~]# pip list | grep boto

boto (2.42.0)

botocore (1.4.60)

But the code specifies a newer version:

required_boto_version = '2.8.0'

boto_vpc documentation

I tried to upgrade the version of boto that I was using with the following command:

[root@salt ~]# pip install boto --upgrade

Requirement already up-to-date: boto in /usr/lib/python2.7/site-packages

But that’s the response I get. Any ideas on how I can get the required version? I'm using this on CentOS 7.

Upvotes: 1

Views: 143

Answers (1)

Pier
Pier

Reputation: 359

Make sure you have installed the boto and boto3 modules. I had the same error, but once installed both modules, it got fixed.

Upvotes: 1

Related Questions