Skip to content

Instantly share code, notes, and snippets.

@fxdgear
Created December 20, 2013 03:57
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 fxdgear/8d8f83dbceefe940093a to your computer and use it in GitHub Desktop.
Save fxdgear/8d8f83dbceefe940093a to your computer and use it in GitHub Desktop.
openssh state file
{% set openssh = pillar.get('openssh', {}) -%}
{% set version = openssh.get('version', 'stable') -%}
{% set checksum = openssh.get('checksum', 'sha1=12755897666792eb9e1a0b7e4589eb1cb8e229d0') -%}
{% set root = openssh.get('root', '/usr/local') -%}
openssh-server:
pkg.removed:
- name:
- openssh-server
openssh-dependencies:
pkg.installed:
- names:
- zlib1g
- zlib1g-dev
- libssl-dev
- libpam0g-dev
- make
## Get openssh
get-openssh:
file.managed:
- name: {{ root }}/openssh-{{ version }}.tar.gz
- source: http://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-{{version}}.tar.gz
- source_hash: {{ checksum }}
- require:
- pkg: openssh-dependencies
cmd.wait:
- cwd: {{ root }}
- names:
- tar -zxvf {{ root }}/openssh-{{ version }}.tar.gz -C {{ root }}
- watch:
- file: get-openssh
install-openssh:
cmd.wait:
- cwd: {{ root }}/openssh-{{ version }}
- names:
- ./configure --prefix=/usr --libexecdir=/usr/lib/openssh --sysconfdir=/etc/ssh --with-pid-dir=/var/run --with-md5-passwords --with-pam
- make
- make install
- watch:
- cmd: get-openssh
restart-openssh:
cmd.wait:
- name: /etc/init.d/ssh restart
- watch:
- cmd: install-openssh
@fxdgear
Copy link
Author

fxdgear commented Dec 20, 2013

Pillar Data:

openssh:
  version: 6.4p1
  checksum: sha1=cf5fe0eb118d7e4f9296fbc5d6884965885fc55d
  root: /usr/local

@whiteinge
Copy link

install-openssh:
  cmd.wait:
    - cwd: {{ root }}/openssh-{{ version }}
    - name: |
        ./configure --prefix=/usr --libexecdir=/usr/lib/openssh --sysconfdir=/etc/ssh --with-pid-dir=/var/run --with-md5-passwords --with-pam
        make
        make install
    - watch:
      - cmd: get-openssh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment