Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 130 lines (99 sloc) 3.2 KB
#! /usr/bin/env ansible-playbook
---
- hosts: all
gather_facts: False
become_user: root
become: yes
connection: local
vars:
user: "{{ lookup('env', 'USER') }}"
user: "chillar"
home: "{{ lookup('env', 'HOME') }}"
config_dir: "{{ home }}/projects/eddie"
config_bin: "{{ home }}/projects/eddie/ubuntu/bin"
venv_dir: "{{ home }}/.virtualenvs"
venv_name: "py36"
venv_bin: "{{ venv_dir }}/{{ venv_name }}/bin/"
ubuntu_config: '{{ config_dir }}/ubuntu/config'
postgres_password: "{{ lookup('env', 'POSTGRES_PASSWORD') }}"
links:
- { src: '{{ ubuntu_config }}/zsh/zshrc.sh', dest: '{{ home }}/.zshrc' }
- { src: '{{ ubuntu_config }}/tmuxinator', dest: '{{ home }}/.tmuxinator' }
- { src: '{{ config_dir }}/python/ipython_config.py', dest: '{{ home }}/.ipython/profile_default/ipython_config.py'}
- { src: '{{ home }}/projects/vendor/tor-browser_en-US/Browser/start-tor-browser', dest: '/usr/local/bin/tor'}
- { src: '{{ ubuntu_config }}/autostart', dest: '{{ home }}/.config/autostart'}
roles:
# - kubernetes
- cli
- db
- android
- latex
- telugu
# - gui
- python
- security
# - java
# - haskell
pre_tasks:
# - name: Add third party PPAs
# apt_repository: repo={{ item }} state=present
# with_items:
# - ppa:synapse-core/ppa
# - ppa:nathan-renniewaldock/flux
- name: apt update cache
apt: update_cache=yes cache_valid_time=86400
tasks:
# - name: Install docker
# command: curl -sSL https://get.docker.com/ | sudo bash
# - name: Give permissions
# command: usermod -aG docker $(whoami)
# - git: repo=git://foosball.example.org/path/to/repo.git
# dest: /home/chillaranand/.qfc
# - name: install watchman
# command: sudo npm install -g watchman
# - name: mysql-python dependencies
# apt: name=libmysqlclient-dev state=present
- name: remove symlinks
file:
state: absent
path: '{{ item.dest }}'
with_items: '{{ links }}'
- name: create symlinks for files
file:
state: link
src: '{{ item.src }}'
dest: '{{ item.dest }}'
with_items: '{{ links }}'
# - name: create startup service
# template:
# src: '../templates/{{ item }}.service.j2'
# dest: '/etc/systemd/system/{{ item }}.service'
# mode: 0777
# notify: reload systemctl
# with_items:
# - dropbox
# become_user: root
- name: disable error reporting
lineinfile:
dest: /etc/default/apport
regexp: '^enabled='
line: 'enabled=0'
become_user: root
- name: enable sar
lineinfile:
dest: /etc/default/sysstat
regexp: '^ENABLED'
line: 'ENABLED="true"'
- name: increase history size
lineinfile:
dest: /etc/default/sysstat
regexp: '^HISTORY'
line: 'HISTORY=365'
- name: install packages from binaries
include: binary_install.yml package="{{ item }}"
with_items:
- {name: 'certbot-auto', url: 'https://dl.eff.org/certbot-auto'}
handlers:
- name: reload systemctl
command: systemctl daemon-reload
become: yes