Skip to content

Instantly share code, notes, and snippets.

@ev0rtex
Created March 11, 2015 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ev0rtex/d70e1c454dfd47cd7cee to your computer and use it in GitHub Desktop.
Save ev0rtex/d70e1c454dfd47cd7cee to your computer and use it in GitHub Desktop.
SaltStack
# 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