zap

Ansible Role: Zap

Build Status

I'm automating my entire fleet using ansible. This role installs zap.

Requirements

  • On local machine: Working ansible installation
  • On remote machine: python and python-simplejson for ansible to work.

Role Variables

# Common:
zap_standalone: yes # installs with root privileges on port 80
zap_host: 127.0.0.1 # change to 0.0.0.0 for server installs
zap_port: 80 # change to 8927 if zap_standalone: no
zap_config: # default YAML config from https://github.com/issmirnov/zap/blob/master/c.yml

# OSX:
zap_config_location: /usr/local/etc/zap

# Ubuntu
zap_config_location: /etc/zap
zap_bin_path: /usr/local/bin

Example Playbook

- hosts: servers
  vars:
    zap_config:
      e:
        expand: example.com
        a:
          expand: apples
      g:
        expand: github.com
        z:
          expand: issmirnov/zap
  roles:
    - { role: issmirnov.zap}

If you are provisioning a bare bones server, you can prepend this stanza to install core ansible dependencies automatically.

- name: install python on bare server
  remote_user: root
  hosts: all
  gather_facts: no
  pre_tasks:
    - name: 'install python2 and json support'
      raw: sudo apt-get -y install python-simplejson

Notes

  • This playbook will not remove deleted entries, nor will it gracefully handle conflicting DNS entries. This is the responsibility of the user.

TODO

  • Add knob that allows user to have zap run under 0.0.0.0.
    • zap_public, used in config flags.

License

MIT

Author Information

Ivan Smirnov, http://ivansmirnov.name

About

Installs zap, a url redirector.

Install
ansible-galaxy install issmirnov/ansible-role-zap
GitHub repository
License
mit
Downloads
59
Owner
Lifelong learner that dreams in code.