Skip to content

Instantly share code, notes, and snippets.

@mikecmpbll
Last active March 30, 2017 14:30
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 mikecmpbll/9f15e0132b479480173d7ba82d9857c9 to your computer and use it in GitHub Desktop.
Save mikecmpbll/9f15e0132b479480173d7ba82d9857c9 to your computer and use it in GitHub Desktop.
----------
ID: Update static config portion
Function: file.blockreplace
Name: /etc/redis/6379.conf
Result: False
Comment: Recursive requisite found
Started:
Duration:
Changes:
----------
ID: redis_6379
Function: service.running
Result: False
Comment: One or more requisite failed: redis.server.Update static config portion
Started:
Duration:
Changes:
Exctract redis source archive:
archive.extracted:
- name: /tmp/
- source: http://download.redis.io/releases/redis-{{ pillar['redis-version'] }}.tar.gz
- source_hash: sha1=6780d1abb66f33a97aad0edbe020403d0a15b67f
- archive_format: tar
- if_missing: /usr/local/bin/redis-server
Build redis:
cmd.run:
- name: make && make install
- cwd: /tmp/redis-{{ pillar['redis-version'] }}
- require:
- archive: Exctract redis source archive
- pkg: build-essential
- unless: '[ -f /usr/local/bin/redis-server ]'
build-essential:
pkg.installed
/etc/init.d/redis_6379:
file.managed:
- source: salt://redis/server-service
- mode: 644
redis_6379:
service.running:
- enable: True
- require:
- cmd: Build redis
- file: /etc/init.d/redis_6379
- file: /etc/redis/6379.conf
- watch:
- file: /etc/redis/6379.conf
/etc/redis/6379.conf:
file.managed:
- source: salt://redis/server.conf
- replace: False
- makedirs: True
Update static config portion:
file.blockreplace:
- name: /etc/redis/6379.conf
- source: salt://redis/server-config-block.conf
- marker_start: "# START MANAGED BY SALT ---DO-NOT-EDIT"
- marker_end: "# END MANAGED BY SALT ---DO-NOT-EDIT"
- prepend_if_not_found: True
- require:
- file: /etc/redis/6379.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment