Skip to content

Commit

Permalink
merged with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim O'Guin committed Jan 6, 2015
2 parents be972d9 + e8e01e3 commit b19c3ac
Show file tree
Hide file tree
Showing 24 changed files with 830 additions and 344 deletions.
53 changes: 53 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,59 @@ Install salt cloud.
Install salt-ssh with roster file.
Configure pillar data under salt:ssh_roster to feed the template.

``salt.standalone``
-------------------

Install a minion and configure it in `standalone mode
<http://docs.saltstack.com/en/latest/topics/tutorials/standalone_minion.html>`_.

``salt.pkgrepo``
----------------

Enable the official saltstack package repository in order to always
benefit from the latest version. This state currently only works on Debian
and Ubuntu, and aims to implement the `installation recommendations of the
official documentation
<http://docs.saltstack.com/en/latest/topics/installation/index.html#platform-specific-installation-instructions>`_.

``salt.pkgrepo.absent``
-----------------------

Undo the effects of ``salt.pkgrepo``.

``salt.formulas``
-----------------

Clone selected `Salt formulas
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_
Git repositories under ``/srv/formulas`` and makes them available in the
relevant ``file_roots`` settings. Pillar data can be used to customize all
paths, URLs, etc.

Here's a minimal pillar sample installing two formulas in the base
environment.

::

salt_formulas:
list:
base:
- salt-formula
- openssh-formula

See pillar.example for an exhaustive list of settings available via pillar. Note
that by default this state:

- downloads the latest formulas from the `saltstack-formulas project
<https://github.com/saltstack-formulas>`_ on GitHub.
- does not update the local repositories after the initial clone.
This is a safety measure since you do not control how the official
repositories evolve.

If you configure the state to download the formulas from repositories that
you control, then you can safely enable the
``salt_formulas:git_opts:default:update`` pillar setting to ``True``.

``Configuration``
=================
Every option available in the templates can be set in pillar. Settings under 'salt' will be overridden by more specific settings under ``salt['master']``, ``salt['minion']`` or ``salt['cloud']``
Expand Down
49 changes: 48 additions & 1 deletion pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ salt:
- git
- roots
gitfs_remotes:
- git://github.com/saltstack-formulas/salt-formula.git
- git://github.com/saltstack-formulas/salt-formula.git:
- base: develop
file_roots:
base:
- /srv/salt
minion:
master: salt
fileserver_backend:
- git
- roots
gitfs_remotes:
- git://github.com/saltstack-formulas/salt-formula.git:
- base: develop
file_roots:
base:
- /srv/salt
module_config:
test: True
test.foo: foo
Expand Down Expand Up @@ -64,3 +73,41 @@ salt_cloud_certs:
-----BEGIN RSA PRIVATE KEY-----
...........
-----END RSA PRIVATE KEY-----

salt_formulas:
git_opts:
# The Git options can be customized differently for each
# environment, if an option is missing in a given environment, the
# value from "default" is used instead.
default:
# URL where the formulas git repositories are downloaded from
# it will be suffixed with <formula-name>.git
baseurl: https://github.com/saltstack-formulas
# Directory where Git repositories are downloaded
basedir: /srv/formulas
# Update the git repository to the latest version (False by default)
update: False
# Options passed directly to the git.latest state
options:
rev: master
dev:
basedir: /srv/formulas/dev
update: True
options:
rev: develop
# Options of the file.directory state that creates the directory where
# the git repositories of the formulas are stored
basedir_opts:
makedirs: True
user: root
group: root
mode: 755
# List of formulas to enable in each environment
list:
base:
- salt-formula
- postfix-formula
dev:
- salt-formula
- postfix-formula
- openssh-formula
4 changes: 2 additions & 2 deletions salt/cloud.sls
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pycrypto:
- require:
- pkg: python-pip
{% if grains['os_family'] != 'Debian' %}
{% if grains['os_family'] not in ['Debian', 'RedHat'] %}
crypto:
pip.installed:
- require:
Expand All @@ -28,7 +28,7 @@ salt-cloud:
- require:
- pip: apache-libcloud
- pip: pycrypto
{% if grains['os_family'] != 'Debian' %}
{% if grains['os_family'] not in ['Debian', 'RedHat'] %}
- pip: crypto
{% endif %}
Expand Down
7 changes: 7 additions & 0 deletions salt/files/cloud.maps.d/saltify.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file is managed by Salt via {{ source }}
make_salty:
- someinstance:
ssh_host: somehost.somedomain
ssh_username: user
password: password
sudo: True
3 changes: 3 additions & 0 deletions salt/files/cloud.profiles.d/saltify.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is managed by Salt via {{ source }}
make_salty:
provider: saltify
5 changes: 2 additions & 3 deletions salt/files/cloud.providers.d/ec2.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file managed by Salt, do not edit by hand!!
{% set salt = pillar.get('salt', {}) -%}
{% set cloud = salt.get('cloud', {}) -%}
{% set cloud = salt['pillar.get']('salt:cloud', {}) -%}
ec2_ubuntu_public:
minion:
master: {{ cloud['master'] }}
Expand All @@ -14,4 +13,4 @@ ec2_ubuntu_public:
location: eu-west-1
availability_zone: eu-west-1a
ssh_username: ubuntu
provider: ec2
provider: ec2
5 changes: 2 additions & 3 deletions salt/files/cloud.providers.d/gce.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file managed by Salt, do not edit by hand!!
{% set salt = pillar.get('salt', {}) -%}
{% set cloud = salt.get('cloud', {}) -%}
{% set cloud = salt['pillar.get']('salt:cloud', {}) -%}
gce:
project: "{{ cloud['gce_project'] }}"
service_account_email_address: "{{ cloud['gce_service_account_email_address'] }}"
Expand All @@ -9,4 +8,4 @@ gce:
master: {{ cloud['master'] }}
grains:
test: True
provider: gce
provider: gce
3 changes: 1 addition & 2 deletions salt/files/cloud.providers.d/rsos.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# This file managed by Salt, do not edit by hand!!
# Providers for openstack-based Rackspace cloud servers.

{% set salt = pillar.get('salt', {}) -%}
{% set cloud = salt.get('cloud', {}) -%}
{% set cloud = salt['pillar.get']('salt:cloud', {}) -%}
{% for region in cloud.get('rsos_regions', []) %}

rsos_{{ region|lower }}:
Expand Down
3 changes: 3 additions & 0 deletions salt/files/cloud.providers.d/saltify.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is managed by Salt via {{ source }}
saltify:
provider: saltify
Loading

0 comments on commit b19c3ac

Please sign in to comment.