diff --git a/pillar.example b/pillar.example index 614cc7d..6296629 100644 --- a/pillar.example +++ b/pillar.example @@ -106,6 +106,23 @@ salt: - IAD - SYD - HKG + + # Configure the proxmox providers you want to use (one per cluster, normally) + proxmox_providers: + test: + user: root@pam + password: password + url: prox-test.mydomain + live: + user: root@pam + password: password + url: prox-live.mydomain + + # You'll need to hand-edit your profiles, but you can insert a default root password + # from here + proxmox_profile_defaults: + default_password: somesecretpassword + reactor: - 'deploy': - /srv/salt/reactors/deploy.sls diff --git a/salt/files/cloud.profiles.d/proxmox.conf b/salt/files/cloud.profiles.d/proxmox.conf new file mode 100644 index 0000000..60a5f8a --- /dev/null +++ b/salt/files/cloud.profiles.d/proxmox.conf @@ -0,0 +1,19 @@ +# This file managed by Salt, do not edit by hand!! +{% set cloud = salt['pillar.get']('salt:cloud', {}) -%} +{% if 'proxmox_profile_defaults' in cloud %} +{% set defaults = cloud.get('proxmox_profile_defaults') %} + +prox-test-1: + provider: proxmox-test + image: ISO:vztmpl/debian-7.0-standard_7.0-2_i386.tar.gz + technology: openvz + host: testvm01 + cpus: 2 + memory: 2048 + swap: 2048 + disk: 5 + password: {{ defaults.get('default_password', 'password') }} + ip_address: 192.168.1.100 + +{% endif %} + diff --git a/salt/files/cloud.providers.d/proxmox.conf b/salt/files/cloud.providers.d/proxmox.conf new file mode 100644 index 0000000..415753c --- /dev/null +++ b/salt/files/cloud.providers.d/proxmox.conf @@ -0,0 +1,11 @@ +# This file managed by Salt, do not edit by hand!! +{% set cloud = salt['pillar.get']('salt:cloud', {}) -%} +{% for name, config in cloud.get('proxmox_providers',dict()).items() %} +proxmox-{{ name }}: + minion: + master: {{ cloud.get('master', 'salt') }} + user: {{ config.get('user', '') }} + password: {{ config.get('password', '') }} + url: {{ config.get('url', '') }} + provider: proxmox +{% endfor %}