This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, fork salt. This example will use https://github.com/ryan-lane/salt | |
git clone git@github.com:saltstack/salt.git | |
cd salt | |
git remote add myfork git@github.com:saltstack/salt.git | |
git checkout -b stable-2015.8 | |
git reset --hard origin/2015.8 | |
git push myfork stable-2015.8 | |
# Making PRs against 2015.8 | |
git checkout 2015.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cache something | |
_cache_id('elb', sub_resource=name, resource_id=lb[0], region=region, key=key, keyid=keyid, profile=profile) | |
# retrieve the cached item | |
_cache_id('elb', sub_resource=name, region=region, key=key, keyid=keyid, profile=profile) | |
# Invalidate something | |
_cache_id('elb', sub_resource=name, invalidate=True, region=region, key=key, keyid=keyid, profile=profile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if pillar.environment == 'production' %} | |
Ensure instance1 is configured: | |
file.managed: | |
- name /var/local/instance1/context.xml | |
- source: salt://instance.xml.tmpl | |
- template: jinja | |
- context: | |
somesetting: testme | |
{% else %} | |
Ensure instance1 is configured: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comment: An exception occurred in this state: Traceback (most recent call last): | |
File "venv/src/salt/salt/state.py", line 1563, in call | |
**cdata['kwargs']) | |
File "mymodules/states/boto_dynamodb.py", line 371, in present | |
s3_base_location=config['s3_base_location'], | |
File "mymodules/states/boto_dynamodb.py", line 462, in _ensure_backup_datapipeline_present | |
return __states__['boto_datapipeline.present'](**kwargs) | |
File "venv/src/salt/salt/utils/lazy.py", line 87, in __getitem__ | |
return self._dict[key] | |
KeyError: 'boto_datapipeline.present' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
saltmastertest_role: | |
boto_iam_role.present: | |
- name: saltmastertest | |
- region: us-east-1 | |
- policies: | |
saltmastertest: | |
Version: '2012-10-17' | |
Statement: | |
- Action: | |
- 'ec2:*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ensure instance1 is configured: | |
file.managed: | |
- name /var/local/instance1/context.xml | |
- source: salt://instance.xml.tmpl | |
- template: jinja | |
- context: | |
var1: some content | |
var2: more content | |
Ensure instance2 is configured: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users: | |
testuser: | |
full_name: Test User | |
id: 1001 | |
disabled: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deployment_config: | |
parent_dir: /srv | |
redis: | |
host: myredisserver.example.com | |
port: 6379 | |
db: 0 | |
repo_config: | |
'ricochet/ricochet': | |
upstream: 'https://github.com/trebuchet-deploy/ricochet' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#grep maxlogins /etc/security/limits.conf /etc/security/limits.d/* | |
mycommand to be run: | |
- cmd | |
- run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic usage (uses default pillar profile key 'grafana') | |
Ensure myservice dashboard is managed: | |
grafana.dashboard_present: | |
- name: myservice | |
- dashboard_from_pillar: default | |
- rows_from_pillar: | |
- systemhealth | |
- requests |