diff --git a/dotfiles.yml b/dotfiles.yml new file mode 100644 index 0000000..9fe829c --- /dev/null +++ b/dotfiles.yml @@ -0,0 +1,47 @@ +--- +- name: Setup the machine as a root user + hosts: localhost + become: yes + become_user: root + roles: + - { role: franklinkim.vim, tags: vim, + vim_config: [ 'set expandtab' ] } + - { role: jdauphant.sublimetext, tags: sublimetext } + - { role: igor_mukhin.sublimetext3_packagecontrol, tags: sublimetext, + packagecontrol_packages: [ + "AutoFileName", + "Git", + "GitGutter", + "Terminal" ] } + - { role: geerlingguy.git, tags: git, + git_packages: [ + "git-gui", + "gitk" ] } + - { role: kosssi.phpstorm, tags: phpstorm } + - { role: ansiblebit.oracle-java, tags: phpstorm, + oracle_java_set_as_default: yes } + - { role: franklinkim.docker, tags: docker } + - { role: franklinkim.docker-compose, tags: docker, + docker_compose_version: 1.4.1 } + - { role: glennr.oh-my-zsh, tags: shell, + user: pierre } + +- name: Setup user settings + hosts: localhost + become: no + tasks: + - name: ensure Git is properly configured + template: src=templates/gitconfig.j2 dest={{ansible_env.HOME}}/.gitconfig + +# TODO +# Docker: extend to have nginx proxy: +# see https://github.com/weareinteractive/ansible-docker/blob/master/defaults/main.yml +# https://github.com/clvv/fasd +# Vault for passwords and sensitive data: http://docs.ansible.com/ansible/playbooks_vault.html +# +# Galaxy +# apt-repository: https://galaxy.ansible.com/list#/roles/3632 +# php: https://galaxy.ansible.com/list#/roles/1232 +# +# BIOS : +# switch ctrl / fn \ No newline at end of file diff --git a/hosts b/hosts new file mode 100644 index 0000000..3824243 --- /dev/null +++ b/hosts @@ -0,0 +1,2 @@ +[local] + 127.0.0.1 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..a60d581 --- /dev/null +++ b/install.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +sudo apt-add-repository ppa:ansible/ansible +sudo apt-get update +sudo apt-get install -y software-properties-common ansible + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..da129ce --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +franklinkim.vim +jdauphant.sublimetext +igor_mukhin.sublimetext3_packagecontrol +geerlingguy.git +ansiblebit.oracle-java +kosssi.phpstorm +franklinkim.docker +franklinkim.docker-compose +glennr.oh-my-zsh \ No newline at end of file diff --git a/templates/gitconfig.j2 b/templates/gitconfig.j2 new file mode 100644 index 0000000..a2aee98 --- /dev/null +++ b/templates/gitconfig.j2 @@ -0,0 +1,17 @@ +# {{ansible_managed}} + +[user] + email=pierre@occitech.fr + name=Pierre Martin +[alias] + co = checkout +[color] + diff = auto + status = auto + branch = auto + interactive = auto + ui = true +[core] + excludesfile = ~/.gitignore + editor = vim + filemode = false \ No newline at end of file diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..5fef19b --- /dev/null +++ b/update.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +ansible-playbook --ask-become-pass dotfiles.yml -i hosts \ + || sudo ansible-galaxy install -r requirements.txt --ignore-errors