Kaynağa Gözat

Merge pull request #58 from juiceinc/ssh-roster

Add salt.ssh state for installing and configuring salt-ssh
tags/v0.57.0
Nitin Madhok 10 yıl önce
ebeveyn
işleme
8100753f71
5 değiştirilmiş dosya ile 49 ekleme ve 6 silme
  1. +6
    -0
      README.rst
  2. +6
    -0
      pillar.example
  3. +12
    -0
      salt/files/roster.jinja
  4. +12
    -6
      salt/package-map.jinja
  5. +13
    -0
      salt/ssh.sls

+ 6
- 0
README.rst Dosyayı Görüntüle

@@ -35,6 +35,12 @@ Install a syndic.

Install salt cloud.

``salt.ssh``
------------

Install salt-ssh with roster file.
Configure pillar data under salt:ssh_roster to feed the template.

``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']``

+ 6
- 0
pillar.example Dosyayı Görüntüle

@@ -45,6 +45,12 @@ salt:
reactor:
- 'deploy':
- /srv/salt/reactors/deploy.sls
ssh_roster:
prod1:
host: host.example.com
user: ubuntu
sudo: True
priv: /etc/salt/ssh_keys/sshkey.pem

salt_cloud_certs:
aws:

+ 12
- 0
salt/files/roster.jinja Dosyayı Görüntüle

@@ -0,0 +1,12 @@
#
# This file is managed by Salt! Do not edit by hand!
#
{%- set roster = salt['pillar.get']('salt:ssh_roster') -%}
{%- if roster %}
{%- for host, options in roster.items() %}
{{ host }}:
{%- for k, v in options.items() %}
{{ k }}: {{ v }}
{%- endfor %}
{% endfor %}
{%- endif -%}

+ 12
- 6
salt/package-map.jinja Dosyayı Görüntüle

@@ -2,27 +2,33 @@
'Debian': {'salt-master': 'salt-master',
'salt-minion': 'salt-minion',
'salt-syndic': 'salt-syndic',
'salt-cloud': 'salt-cloud'},
'salt-cloud': 'salt-cloud',
'salt-ssh': 'salt-ssh'},
'Ubuntu': {'salt-master': 'salt-master',
'salt-minion': 'salt-minion',
'salt-syndic': 'salt-syndic',
'salt-cloud': 'salt-cloud'},
'salt-cloud': 'salt-cloud',
'salt-ssh': 'salt-ssh'},
'CentOS': {'salt-master': 'salt-master',
'salt-minion': 'salt-minion',
'salt-syndic': 'salt-syndic',
'salt-cloud': 'salt-cloud'},
'salt-cloud': 'salt-cloud',
'salt-ssh': 'salt-ssh'},
'Amazon': {'salt-master': 'salt-master',
'salt-minion': 'salt-minion',
'salt-syndic': 'salt-syndic',
'salt-cloud': 'salt-cloud'},
'salt-cloud': 'salt-cloud',
'salt-ssh': 'salt-ssh'},
'Fedora': {'salt-master': 'salt-master',
'salt-minion': 'salt-minion',
'salt-syndic': 'salt-syndic',
'salt-cloud': 'salt-cloud'},
'salt-cloud': 'salt-cloud',
'salt-ssh': 'salt-ssh'},
'RedHat': {'salt-master': 'salt-master',
'salt-minion': 'salt-minion',
'salt-syndic': 'salt-syndic',
'salt-cloud': 'salt-cloud'},
'salt-cloud': 'salt-cloud',
'salt-ssh': 'salt-ssh'},
'Gentoo': {'salt-master': 'app-admin/salt',
'salt-minion': 'app-admin/salt',
'salt-syndic': 'app-admin/salt',

+ 13
- 0
salt/ssh.sls Dosyayı Görüntüle

@@ -0,0 +1,13 @@
{% from "salt/package-map.jinja" import pkgs with context %}

ensure salt-ssh is installed:
pkg.installed:
- name: {{ pkgs['salt-ssh'] }}

ensure roster config:
file.managed:
- name: {{ pkgs.get('config_path', '/etc/salt') }}/roster
- source: salt://salt/files/roster.jinja
- template: jinja
- require:
- pkg: ensure salt-ssh is installed

Yükleniyor…
İptal
Kaydet