Skip to content

Instantly share code, notes, and snippets.

View valentinbud's full-sized avatar

Valentin Bud valentinbud

View GitHub Profile
{{ pillar['warnings']['master'] }}
#
# Sample configuration file for ISC dhcpd for Debian
#
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
diff --git a/salt/modules/lxc.py b/salt/modules/lxc.py
index 26dd259..9e36ae0 100644
--- a/salt/modules/lxc.py
+++ b/salt/modules/lxc.py
@@ -9,6 +9,7 @@ Work with linux containers
import logging
import tempfile
import os
+import ast
diff --git a/salt/modules/lxc.py b/salt/modules/lxc.py
index 26dd259..a6757c3 100644
--- a/salt/modules/lxc.py
+++ b/salt/modules/lxc.py
@@ -68,7 +68,8 @@ def _nic_profile(nic):
def _gen_config(nicp,
cpuset=None,
cpushare=None,
- memory=None):
+ memory=None,
# cat /srv/salt/pillar/lxc/init.sls
lxc.profile:
profile:
debian:
template: debian-wheezy
backing: lvm
vgname: vg0
size: 1G
# cat /srv/salt/pillar/lxc/init.sls
lxc:
profile:
debian:
template: debian-wheezy
backing: lvm
vgname: vg0
size: 1G
# salt-call -l debug lxc.create lxc02 template=debian-wheezy backing=lvm vgname=vg0 size=2G
[ERROR ] An un-handled exception was caught by salt's global exception handler:
TypeError: list indices must be integers, not str
Traceback (most recent call last):
File "/usr/bin/salt-call", line 11, in <module>
salt_call()
File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 77, in salt_call
client.run()
File "/usr/lib/python2.7/dist-packages/salt/cli/__init__.py", line 303, in run
import os
def get_ssh_public_key():
pub_key = ''
with open("/var/lib/one/.ssh/id_rsa.pub", 'rb') as infile:
for line in infile:
pub_key += line
return {'oneadmin_public_key' : pub_key}
remote: UPDATING LOCAL PILLAR
remote: /srv/salt/salt-pillar
remote: fatal: Not a git repository: '.'
#!/bin/bash
#
# This hook updates the local pillar data.
# It basically runs `git pull` in salt master's
# pillar_roots directory.
#
# Only suports one environment - base. The branch is master
# and the environment production.
#
openldap-server:
{% if grains['os'] == 'Debian' %}
package:
name: slapd
version: 2.4.23-7.3
service: slapd
{% endif %}
cn:
config: