resolver playbook

pull/28/head
Alpha Chen 10 years ago
parent 3b89b5cf21
commit bab1979d4b

@ -0,0 +1,6 @@
- hosts: dev
tasks:
- name: install dnsmasq
homebrew: name=dnsmasq state=present
- name: link conf files
command: chdir={{ ansible_env.HOME }}/.dotfiles stow --target=/usr/local/etc/dnsmasq.conf --stow {{ item }}

@ -0,0 +1,32 @@
---
- hosts: all
vars:
dnsmasq_conf: "{{ ansible_env.HOME }}/Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist"
tasks:
- include: tasks/update_dotfiles.yml
- name: Install Dnsmasq
homebrew: name=dnsmasq state=present
- name: Stow dnsmasq.conf
command: chdir={{ ansible_env.HOME }}/.dotfiles stow --target=/usr/local/etc --stow dnsmasq
- name: Make local LaunchDaemons directory
file: path={{ ansible_env.HOME }}/Library/LaunchDaemons state=directory
- name: Delete old launchd config
sudo: True
file: path={{ dnsmasq_conf }} state=absent
# Copy the config instead of linking since it needs to be owned by root.
- name: Copy launchd config
sudo: True
command: cp /usr/local/opt/dnsmasq/homebrew.mxcl.dnsmasq.plist {{ dnsmasq_conf }}
- name: Fix launchd config permissions
sudo: True
file: path={{ ansible_env.HOME }}/Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist owner=root
- name: Load Dnsmasq
sudo: True
command: launchctl load {{ dnsmasq_conf }}
- name: Create /etc/resolver
sudo: True
file: path=/etc/resolver state=directory
# Link instead of stow since there's a stow bug with relative paths.
- name: Symlink /etc/resolver/dev
sudo: True
file: src={{ ansible_env.HOME }}/.dotfiles/resolver/dev dest=/etc/resolver/dev state=link

@ -0,0 +1,3 @@
---
- name: clone/update dotfiles
git: repo=https://github.com/kejadlen/dotfiles.git dest=~/.dotfiles
Loading…
Cancel
Save