1
votes

I'm trying to build up some EC2 resources using saltstack on Ubuntu 14.04. Problem is that the python-boto package that comes with the 14.04 is too old, and I need to use pip to install something more up to date. I have the following SLS to express this state:

python-boto:
  pkg.purged

python-pip:
  pkg.installed

boto:
  pip.installed:
    - name: boto >= 2.6
    - require:
      - pkg: python-pip

default_lc:
  boto_lc.present:
    - require:
      - pip: boto
    - image_id: ami-3d2cce5d 
    - key_name: uberhaus
    - security_groups:
      - default
    - instance_type: m3.medium
    - volume_type: gp2

The first time I run a highstate, the boto_lc resource fails. On subsequent highstate runs, it succeeds.

How do I deal with this? Do I need to use Reactor or Orchestrate to somehow ensure the boto resources are run only after a previous run to install boto?

1
This is confusing. Can you write it in point form? This is what I understand i. Run a highstate to launch Ec2 instance from AMI, i. boto_lc will put salt-minion into the EC2 instance. ii. salt master will accept key iii. Some magic state that not stated here tell minion to update boto to latest version. - mootmoot

1 Answers

0
votes

I think that you need a 'reload_modules: True' in the pip.installed state, which will then make the boto module available for salt to use in the subsequent state(s).