This file contains hidden or 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
#whatever/init.sls | |
install some package | |
do basic configuration | |
include: | |
- .users | |
#whatever/users.sls | |
configure some users for the service |
This file contains hidden or 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
require 'test_helper' | |
require 'virtus' | |
require 'representable/json' | |
class NilFailTest < MiniTest::Spec | |
class Company | |
include Virtus.model | |
attribute :name, String | |
attribute :errors, Hash, default: nil |
This file contains hidden or 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
#!/usr/bin/env python | |
import salt.config | |
import salt.loader | |
import salt.utils | |
__opts__ = salt.config.minion_config('/etc/salt/minion') | |
envutil = salt.loader.raw_mod(__opts__, 'envutil', None) | |
def environment(): | |
fqdn = salt.utils.network.get_fqhostname() |
This file contains hidden or 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
#!/usr/bin/env python | |
import salt.log | |
import salt.utils | |
def environment(): | |
fqdn = salt.utils.network.get_fqhostname() | |
host = fqdn.partition('.')[0] | |
grains = {} | |
environment = __salt__['envutil.infer_env_from_name'](host) |
This file contains hidden or 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
#!/bin/bash | |
echo "Setting hostname to: {{vm['name']}}" | |
echo '{{vm['name']}}' > /etc/hostname | |
hostname -F /etc/hostname | |
echo "Setting private interface address to: {{data['private_ips'][0]}}" | |
cat >>/etc/network/interfaces <<EOF | |
auto eth0:0 |
This file contains hidden or 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
class Logger | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
payload = { | |
remote_addr: env['REMOTE_ADDR'], | |
request_method: env['REQUEST_METHOD'], | |
request_path: env['PATH_INFO'], |
This file contains hidden or 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
setup-rabbit: | |
salt.state: | |
- tgt: 'G@environment:staging and G@provides:rabbitmq:*' | |
- tgt_type: compound | |
- sls: | |
- rabbitmq |
This file contains hidden or 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
# do stuff | |
include: | |
- somesls | |
# do some more stuff | |
include: | |
- anothersls | |
- require: |
This file contains hidden or 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
#salt requires a proper dictionary with declared state, so the file.missing is just a dummy | |
appUserGroup: | |
file.missing: | |
- name: /tmp/aroisntoaursntoyaurnsotnarstnarosetairestoiaernst | |
- &usergroup | |
- user: {{user}} | |
- group: {{group}} | |
- hashvalues: &hashvals | |
some: value |
This file contains hidden or 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
include: | |
- appbase: | |
- context: | |
appname: app1 | |
# do stuff specific to this app |