Skip to content

Instantly share code, notes, and snippets.

@gravyboat
Created August 11, 2014 22:15
Show Gist options
  • Save gravyboat/b7377c6dca088d1e47bc to your computer and use it in GitHub Desktop.
Save gravyboat/b7377c6dca088d1e47bc to your computer and use it in GitHub Desktop.
aptly formula
{
"rootDir": "{{ salt['pillar.get']('aptly:rootdir') }}",
"downloadConcurrency": 4,
"architectures": [],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
"downloadSourcePackages": false,
"ppaDistributorID": "ubuntu",
"ppaCodename": ""
}
server {
root /var/lib/aptly/.aptly/public;
server_name NAME_HERE;
location / {
autoindex on;
}
}
include:
- aptly
aptly_homedir:
file:
- directory
- name: {{ salt['pillar.get']('aptly:homedir', '/var/lib/aptly') }}
- user: aptly
- group: aptly
- mode: 755
- require:
- user: aptly_user
aptly_rootdir:
file:
- directory
- name: {{ salt['pillar.get']('aptly:rootdir', '/var/lib/aptly/.aptly') }}
- user: aptly
- group: aptly
- mode: 755
- require:
- file: aptly_homedir
aptly_conf:
file:
- managed
- name: {{ salt['pillar.get']('aptly:homedir', '/var/lib/aptly') }}/.aptly.conf
- source: salt://aptly/files/.aptly.conf
- template: jinja
- user: aptly
- group: aptly
- mode: 664
- require:
- file: aptly_homedir
aptly_gpg_key_dir:
file:
- directory
- name: {{ salt['pillar.get']('aptly:homedir', '/var/lib/aptly') }}/.gnupg
- user: aptly
- group: aptly
- mode: 700
- require:
- file: aptly_homedir
#import_gpg_pub_key:
# cmd:
# - run
# - name: gpg --import {key.key}
# - unless: 'key_name' in gpg --list-keys
# - require:
# - file: aptly_gpg_key_dir
#import_gpg_priv_key:
# cmd:
# - run
# - name: gpg --allow-secret-key-import --import {private.key}
# - unless: 'key_name' in gpg --list-keys
# - require:
# - file: aptly_gpg_key_dir
# Set up our trusty repos
include:
- aptly
- aptly.aptly_config
create_edge_trusty_repo:
cmd:
- run
- name: aptly repo create -distribution="trusty-edge" company-edge-trusty
- unless: aptly repo show company-edge-trusty
- user: aptly
- require:
- sls: aptly.aptly_config
create_test_trusty_repo:
cmd:
- run
- name: aptly repo create -distribution="trusty-test" company-test-trusty
- unless: aptly repo show company-test-trusty
- user: aptly
- require:
- sls: aptly.aptly_config
create_prod_trusty_repo:
cmd:
- run
- name: aptly repo create -distribution="trusty-prod" company-prod-trusty
- unless: aptly repo show company-prod-trusty
- user: aptly
- require:
- sls: aptly.aptly_config
aptly_repo:
pkgrepo:
- managed
- humanname: Aptly PPA
- name: deb http://repo.aptly.info/ squeeze main
- dist: squeeze
- file: /etc/apt/sources.list.d/aptly.list
- keyid: 2A194991
- keyserver: keys.gnupg.net
- require_in:
- pkg: aptly
aptly:
pkg:
- installed
- name: aptly
- refresh: True
aptly_user:
user:
- present
- name: aptly
- shell: /bin/bash
- home: {{ salt['pillar.get']('aptly:homedir', '/var/lib/aptly') }}
- require:
- pkg: aptly
include:
- nginx
- nginx.config
aptly_site:
file:
- managed
- name: /etc/nginx/sites-enabled/aptly
- source: salt://aptly/files/aptly.jinja
- mode: 644
- user: root
- group: root
- watch_in:
- service: nginx
aptly:
homedir: /var/lib/aptly
rootdir: /var/lib/aptly/.aptly
include:
- aptly.create_trusty_repos
publish_edge:
cmd:
- run
- name: aptly publish repo company-edge-trusty
- user: aptly
- unless: aptly publish update trusty-edge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment