-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2b217d3
Showing
9 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- hosts: all | ||
user: rektide | ||
vars_files: | ||
- "vars/ansible.vars" | ||
tasks: | ||
- include: "tasks/xdg.vars.tasks" | ||
- include: "tasks/ansible.tasks" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- hosts: all | ||
sudo: true | ||
tasks: | ||
- include: "tasks/debdev.tasks" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export ANSIBLE_HOSTS={{ANSIBLE_HOSTS_FILE}} | ||
source {{INSTALL_DIR}}/hacking/env-setup | ||
if [[ -e {{CONFIG_DIR}}/ansible.rc ]] | ||
then | ||
source {{CONFIG_DIR}}/ansible.rc | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
mkdir -p ~/.local/opt ~/.local/bin ~/.config/ansible | ||
[[ ! -d ~/.local/opt/ansible ]] && git clone https://github.com/ansible/ansible.git ~/.local/opt/ansible | ||
[[ ! -e ~/.ansible/hosts.localhost ]] && echo 127.0.0.1 >> ~/.ansible/hosts.localhost | ||
[[ ! -e ~/.ansible/hosts ]] && ln -s ~/.ansible/hosts.localhost ~/.ansible/hosts | ||
[[ ! -e ~/.ansible/env.ansible ]] && cp env.ansible ~/.ansible/env.ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
- name: insure CONFIG_DIR:$CONFIG_DIR exists | ||
file: path=$CONFIG_DIR state=directory | ||
- name: insure INSTALL_DIR:$INSTALL_DIR exists | ||
file: path=$INSTALL_DIR state=directory | ||
#### default hosts file | ||
- name: copy DEFAULT_HOSTS:$DEFAULT_HOSTS into CONFIG_DIR:$CONFIG_DIR | ||
copy: src=files/ansible/$DEFAULT_HOSTS dest=$CONFIG_DIR/ | ||
- name: check for existing ANSIBLE_HOSTS_FILE:$ANSIBLE_HOSTS_FILE | ||
shell: test -e $ANSIBLE_HOSTS_FILE && echo 1 || echo 0 | ||
register: has_ansible_hosts_file | ||
- name: default symlink ANSIBLE_HOSTS_FILE:$ANSIBLE_HOSTS_FILE to DEFAULT_HOSTS:$DEFAULT_HOSTS | ||
file: src=$CONFIG_DIR/$DEFAULT_HOSTS dest=$ANSIBLE_HOSTS_FILE state=link | ||
when_integer: ${has_ansible_hosts_file.stdout} == 0 | ||
#### env setter helper | ||
- name: check for existing CONFIG_DIR/ANSIBLE_ENV:$CONFIG_DIR/$ANSIBLE_ENV | ||
shell: test -e $CONFIG_DIR/$ANSIBLE_ENV && echo 1 || echo 0 | ||
register: has_ansible_env | ||
- name: template ANSIBLE_ENV:$ANSIBLE_ENV into CONFIG_DIR:$CONFIG_DIR | ||
template: src=files/ansible/$ANSIBLE_ENV dest=$CONFIG_DIR/$ANSIBLE_ENV | ||
when_integer: ${has_ansible_env.stdout} == 0 | ||
#### link to install | ||
- name: check for existing CONFIG_DIR/INSTALL_LINK:$CONFIG_DIR/$INSTALL_LINK install link | ||
shell: test -e $CONFIG_DIR/$INSTALL_LINK && echo 0 || echo 1 | ||
register: need_install_link | ||
- name: creating install link CONFIG_DIR/INSTALL_LINK:$CONFIG_DIR/$INSTALL_LINK to $INSTALL_DIR | ||
file: src=$INSTALL_DIR dest=$CONFIG_DIR/$INSTALL_LINK state=link | ||
when_integer: ${need_install_link.stdout} > 0 and ${has_xdg_config_dir.stdout} > 0 | ||
#### xdg_config_dir/ansible install | ||
- name: check whether xdg_config_dir exists qand is different from CONFIG_DIR:$CONFIG_DIR | ||
shell: test "${has_xdg_config_dir.stdout}" == 1 -a "x${xdg_config_dir.stdout}" != "x$CONFIG_DIR" -a ! -e "${xdg_config_dir.stdout}/ansible" && echo 1 || echo 0 | ||
register: need_config_link | ||
- name: create xdg_config_dir:${xdg_config_dir.stdout} link to $CONFIG_DIR | ||
file: src=$CONFIG_DIR dest=${xdg_config_dir.stdout}/ansible state=link | ||
when_integer: ${need_config_link.stdout} > 0 | ||
### install git | ||
- name: git clone ansible repo | ||
git: repo=$ANSIBLE_GIT dest=$INSTALL_DIR | ||
- name: apt-get install ansible dependencies | ||
apt: pkg=$DEPS state=latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- name: mini-dinstall, debrelease, dput deps | ||
apt: pkg=mini-dinstall,dput,pbuilder,devscripts,fakeroot state=latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: get xdg_config_dir | ||
shell: echo ${XDG_CONFIG_HOME:-~/.config} | ||
register: xdg_config_dir | ||
- name: test xdg_config_dir | ||
shell: test -d $xdg_config_dir && echo 1 || echo 0 | ||
register: has_xdg_config_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
DEPS: python-jinja2,python-yaml,python-paramiko,python-apt | ||
ANSIBLE_GIT: https://github.com/ansible/ansible.git | ||
INSTALL_DIR: ~/.local/opt/ansible | ||
CONFIG_DIR: ~/.ansible | ||
BIN_DIR: ~/.local/bin/ | ||
ANSIBLE_HOSTS_FILE: $CONFIG_DIR/hosts | ||
DEFAULT_HOSTS: hosts.localhost | ||
ANSIBLE_ENV: env.ansible | ||
INSTALL_LINK: lib |