{% for type in ['pem'] %} | {% for type in ['pem'] %} | ||||
cloud-cert-{{ cert }}-pem: | cloud-cert-{{ cert }}-pem: | ||||
file.managed: | file.managed: | ||||
- name: /etc/salt/pki/cloud/{{ cert }}.pem | |||||
- name: {{ salt_settings.config_path }}/pki/cloud/{{ cert }}.pem | |||||
- source: salt://{{ slspath }}/files/key | - source: salt://{{ slspath }}/files/key | ||||
- template: jinja | - template: jinja | ||||
- user: root | - user: root | ||||
{%- for dir, templ_path in salt_settings.cloud.template_sources.items() %} | {%- for dir, templ_path in salt_settings.cloud.template_sources.items() %} | ||||
salt-cloud-{{ dir }}: | salt-cloud-{{ dir }}: | ||||
file.recurse: | file.recurse: | ||||
- name: /etc/salt/cloud.{{ dir }}.d | |||||
- name: {{ salt_settings.config_path }}/cloud.{{ dir }}.d | |||||
- source: {{ templ_path }} | - source: {{ templ_path }} | ||||
- template: jinja | - template: jinja | ||||
- makedirs: True | - makedirs: True | ||||
salt-cloud-providers-permissions: | salt-cloud-providers-permissions: | ||||
file.directory: | file.directory: | ||||
- name: /etc/salt/cloud.providers.d | |||||
- name: {{ salt_settings.config_path }}/cloud.providers.d | |||||
- user: root | - user: root | ||||
- group: root | - group: root | ||||
- file_mode: 600 | - file_mode: 600 |
# This file managed by Salt, do not edit by hand!! | # This file managed by Salt, do not edit by hand!! | ||||
{% set cloud = salt['pillar.get']('salt:cloud', {}) -%} | |||||
{% if 'aws_key' in cloud %} | |||||
{%- from "salt/map.jinja" import salt_settings with context -%} | |||||
{%- set cloud = salt['pillar.get']('salt:cloud', {}) -%} | |||||
{%- if 'aws_key' in cloud %} | |||||
ec2_ubuntu_public: | ec2_ubuntu_public: | ||||
minion: | minion: | ||||
master: {{ cloud.get('master', 'salt') }} | master: {{ cloud.get('master', 'salt') }} | ||||
ssh_interface: public_ips | ssh_interface: public_ips | ||||
id: {{ cloud.get('aws_key', 'DEFAULT') }} | id: {{ cloud.get('aws_key', 'DEFAULT') }} | ||||
key: '{{ cloud.get('aws_secret', 'DEFAULT') }}' | key: '{{ cloud.get('aws_secret', 'DEFAULT') }}' | ||||
private_key: /etc/salt/pki/cloud/ec2.pem | |||||
private_key: {{ salt_settings.config_path }}/pki/cloud/ec2.pem | |||||
keyname: keyname | keyname: keyname | ||||
location: eu-west-1 | location: eu-west-1 | ||||
availability_zone: eu-west-1a | availability_zone: eu-west-1a | ||||
ssh_username: ubuntu | ssh_username: ubuntu | ||||
provider: ec2 | provider: ec2 | ||||
{% endif %} | |||||
{%- endif %} |
# This file managed by Salt, do not edit by hand!! | # This file managed by Salt, do not edit by hand!! | ||||
{%- from "salt/map.jinja" import salt_settings with context -%} | |||||
{%- set cloud = salt['pillar.get']('salt:cloud', {}) -%} | {%- set cloud = salt['pillar.get']('salt:cloud', {}) -%} | ||||
{%- if 'gce_project' in cloud %} | {%- if 'gce_project' in cloud %} | ||||
gce: | gce: | ||||
project: "{{ cloud.get('gce_project', 'DEFAULT') }}" | project: "{{ cloud.get('gce_project', 'DEFAULT') }}" | ||||
service_account_email_address: "{{ cloud.get('gce_service_account_email_address', 'DEFAULT') }}" | service_account_email_address: "{{ cloud.get('gce_service_account_email_address', 'DEFAULT') }}" | ||||
service_account_private_key: "/etc/salt/pki/cloud/gce.pem" | |||||
service_account_private_key: "{{ salt_settings.config_path }}/pki/cloud/gce.pem" | |||||
minion: | minion: | ||||
master: {{ cloud.get('master', 'salt') }} | master: {{ cloud.get('master', 'salt') }} | ||||
grains: | grains: |
# clean up old _defaults.conf file if they have it around | # clean up old _defaults.conf file if they have it around | ||||
remove-old-master-conf-file: | remove-old-master-conf-file: | ||||
file.absent: | file.absent: | ||||
- name: /etc/salt/master.d/_defaults.conf | |||||
- name: {{ salt_settings.config_path }}/master.d/_defaults.conf |
# clean up old _defaults.conf file if they have it around | # clean up old _defaults.conf file if they have it around | ||||
remove-old-minion-conf-file: | remove-old-minion-conf-file: | ||||
file.absent: | file.absent: | ||||
- name: /etc/salt/minion.d/_defaults.conf | |||||
- name: {{ salt_settings.config_path }}/minion.d/_defaults.conf |
# clean up old _defaults.conf file if they have it around | # clean up old _defaults.conf file if they have it around | ||||
remove-old-standalone-conf-file: | remove-old-standalone-conf-file: | ||||
file.absent: | file.absent: | ||||
- name: /etc/salt/minion.d/_defaults.conf | |||||
- name: {{ salt_settings.config_path }}/minion.d/_defaults.conf |