Created
March 11, 2015 19:34
-
-
Save ev0rtex/d70e1c454dfd47cd7cee to your computer and use it in GitHub Desktop.
SaltStack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get version information | |
{% set versions = salt['pillar.get']('versions', { | |
"libsodium": "1.0.2" | |
}, True) %} | |
# Fetch libsodium tar and hash | |
{% do salt['cp.get_url']( | |
"https://download.libsodium.org/libsodium/releases/libsodium-" ~ versions.libsodium ~ ".tar.gz", | |
"/tmp/libsodium.tar.gz" | |
) %} | |
{% set hash = salt['cp.hash_file']("/tmp/libsodium.tar.gz") %} | |
libsodium: | |
archive.extracted: | |
- name: /tmp | |
- source: /tmp/libsodium.tar.gz | |
- source_hash: {{ hash.hash_type ~ "=" ~ hash.hsum }} | |
- archive_format: tar | |
- if_missing: /tmp/libsodium-{{ versions.libsodium }} | |
cmd.run: | |
- name: | | |
cd /tmp/libsodium-{{ versions.libsodium }} | |
./configure | |
make | |
make install | |
- unless: test -x /usr/local/lib/libsodium.so | |
- require: | |
- archive: libsodium | |
pip: | |
pkg.installed: | |
- name: python-pip | |
- reload_modules: True | |
- require: | |
- cmd: libsodium | |
raet: | |
pip.installed: | |
- name: raet | |
- require: | |
- pkg: pip | |
{% for service in ['master', 'minion'] %} | |
{% if salt['file.file_exists']("/etc/salt/" ~ service) %} | |
enable_raet_{{ service }}: | |
file.append: | |
- name: /etc/salt/{{ service }} | |
- text: | | |
##### Transport ##### | |
############################################## | |
transport: raet | |
- require: | |
- pip: raet | |
{% endif %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment