Skip to content

Instantly share code, notes, and snippets.

@oneyb
Created June 22, 2018 22:29
Show Gist options
  • Save oneyb/2cf02de65d53d69dd05a6eb44371de78 to your computer and use it in GitHub Desktop.
Save oneyb/2cf02de65d53d69dd05a6eb44371de78 to your computer and use it in GitHub Desktop.
---
# run this: ansible-playbook -i localhost, -u $USER install-kanboard.yaml --ask-become-pass
- hosts: all
vars:
version: 1.2.5
tasks:
- name: install necessary packages
apt: pkg={{ item }} update_cache=yes cache_valid_time=86400
become: yes
with_items:
- apache2
- libapache2-mod-php7.0
- php7.0-cli
- php7.0-mbstring
- php7.0-sqlite3
- php7.0-opcache
- php7.0-json
- php7.0-mysql
- php7.0-pgsql
- php7.0-ldap
- php7.0-gd
- php7.0-xml
- name: unzip/install kanboard
get_url:
url: "https://github.com/kanboard/kanboard/archive/v{{ version }}.tar.gz"
dest: "{{ ansible_env.HOME }}/bin/src/kanboard-{{ version }}.tar.gz"
- name: decompress install kanboard
unarchive:
# could supply the URL directly but debugging is slower and I don't want
# root accessing the internet...
src: "{{ ansible_env.HOME }}/bin/src/kanboard-{{ version }}.tar.gz"
dest: "/var/www/"
remote_src: yes
become: yes
- name: set ownership
file:
dest: "/var/www/kanboard-{{ version }}/data"
owner: www-data
group: www-data
recurse: yes
become: yes
- name: start apache2
systemd: name={{ item }} state=restarted enabled=yes
become: yes
with_items:
- apache2
# - postgresql
# remove kanboard :(
# - name: stop services
# systemd: name={{ item }} state=stopped enabled=no
# become: yes
# with_items:
# - apache2
# - postgresql
# - name: install necessary packages
# become: yes
# apt: pkg={{ item }} purge=yes state=absent
# with_items:
# - apache2
# - libapache2-mod-php7.0
# - php7.0-cli
# - php7.0-mbstring
# - php7.0-sqlite3
# - php7.0-opcache
# - php7.0-json
# - php7.0-mysql
# - php7.0-pgsql
# - php7.0-ldap
# - php7.0-gd
# - php7.0-xml
# - name: delete files
# file:
# dest: /var/www/html
# state: absent
# become: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment