%PDF- %PDF-
| Direktori : /proc/self/root/proc/thread-self/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/thread-self/root/lib/python2.7/site-packages/salt/states/boto_lc.pyo |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l m Z d � Z d d d d d d d d d d d e d d e d d d d d d � Z
d d d d d � Z d S( u
Manage Launch Configurations
.. versionadded:: 2014.7.0
Create and destroy Launch Configurations. Be aware that this interacts with
Amazon's services, and so may incur charges.
A limitation of this module is that you can not modify launch configurations
once they have been created. If a launch configuration with the specified name
exists, this module will always report success, even if the specified
configuration doesn't match. This is due to a limitation in Amazon's launch
configuration API, as it only allows launch configurations to be created and
deleted.
Also note that a launch configuration that's in use by an autoscale group can
not be deleted until the autoscale group is no longer using it. This may affect
the way in which you want to order your states.
This module uses ``boto``, which can be installed via package, or pip.
This module accepts explicit autoscale credentials but can also utilize
IAM roles assigned to the instance through Instance Profiles. Dynamic
credentials are then automatically obtained from AWS API and no further
configuration is necessary. More information available `here
<http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html>`_.
If IAM roles are not used you need to specify them either in a pillar file or
in the minion's config file:
.. code-block:: yaml
asg.keyid: GKTADJGHEIQSXMKKRBJ08H
asg.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
It's also possible to specify ``key``, ``keyid`` and ``region`` via a profile, either
passed in as a dict, or as a string to pull from pillars or minion config:
.. code-block:: yaml
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
Credential information is shared with autoscale groups as launch configurations
and autoscale groups are completely dependent on each other.
.. code-block:: yaml
Ensure mylc exists:
boto_lc.present:
- name: mylc
- image_id: ami-0b9c9f62
- key_name: mykey
- security_groups:
- mygroup
- instance_type: m1.small
- instance_monitoring: true
- block_device_mappings:
- '/dev/sda1':
size: 20
volume_type: 'io1'
iops: 220
delete_on_termination: true
- cloud_init:
boothooks:
'disable-master.sh': |
#!/bin/bash
echo "manual" > /etc/init/salt-master.override
scripts:
'run_salt.sh': |
#!/bin/bash
add-apt-repository -y ppa:saltstack/salt
apt-get update
apt-get install -y salt-minion
salt-call state.highstate
- region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
# Using a profile from pillars.
Ensure mylc exists:
boto_lc.present:
- name: mylc
- image_id: ami-0b9c9f62
- profile: myprofile
# Passing in a profile.
Ensure mylc exists:
boto_lc.present:
- name: mylc
- image_id: ami-0b9c9f62
- profile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
i ( t absolute_importt print_functiont unicode_literals( t SaltInvocationErrorc C@ s d t k r d St S( u)
Only load if boto is available.
u boto_asg.existsu boto_lc( t __salt__t False( ( ( s7 /usr/lib/python2.7/site-packages/salt/states/boto_lc.pyt __virtual__i s u m1.smallc * C@ s{ | r | r t d � � n i | d 6t d 6d d 6i d 6} t d | d | d | d
| d | �} | smt d r� d
} | | d <d# | d <| S| r� t d | � } n t d | | d | d | d | d | d | d | d | d |
d | d | d |
d | d | d | d | d | d | d
| d | �} | rVd# | d d <| | d d <qwt | d <d! | d <n
d"