Skip to content

Commit

Permalink
Move ansible YAMLs into ops dir
Browse files Browse the repository at this point in the history
Also...

 - change ubuntu pass to 'ubuntu'
 - move vs-code install into its own YAML
 - use xubuntu-desktop meta package
  • Loading branch information
ajmcmiddlin committed Jun 22, 2017
1 parent d9f26d7 commit b611a82
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Vagrant.configure("2") do |config|
end

config.vm.provision 'ansible' do |ansible|
ansible.playbook = 'ansible.yaml'
ansible.playbook = 'ops/ansible.yaml'
end
end
51 changes: 0 additions & 51 deletions ansible.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions ops/ansible.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
- name: "Install ansible deps (Python 2.7 stuff)"
hosts: all
user: ubuntu
gather_facts: false
tasks:
- name: "Install ansible requirements"
raw: apt-get update && apt-get install -y python2.7 python-simplejson
become: yes

- name: "Setup Ubuntu 16.04"
hosts: all
user: ubuntu

tasks:
- name: "Set ubuntu user's password to 'ubuntu'"
user:
name: ubuntu
password: $6$hVCglTDqXKLR45$b4M1N30zbQmieXbHpqm3z1yYCZKNq1jF554WU7AwiBI/z8DkbV1zyE.aYeZvOkCgxsWIJv63IBEwB9riNmdyY/
become: yes

- name: "Install packages"
apt:
name: "{{ item }}"
update_cache: yes
state: present
become: yes
with_items:
- emacs
- git
- tmux
- vim
- xubuntu-desktop

- name: "Automatically login as ubuntu user"
lineinfile:
line: autologin-user=ubuntu
path: /usr/share/lightdm/lightdm.conf.d/60-xubuntu.conf
become: yes

- include: vs-code.yaml
24 changes: 24 additions & 0 deletions ops/vs-code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- name: "Check if VS Code is installed"
command: which code
ignore_errors: true
register: haz_code

- name: "Download VS code"
get_url:
url: https://go.microsoft.com/fwlink/?LinkID=760868
dest: /tmp/vs-code.deb
when: haz_code|failed

# So the recommended install method is to install a thing with broken/missing
# dependencies, and then fix it.
- name: "Install VS Code deb"
command: dpkg -i /tmp/vs-code.deb
become: yes
ignore_errors: true
when: haz_code|failed

- name: "Fix VS code installation"
command: apt-get install -fy
become: yes
when: haz_code|failed

0 comments on commit b611a82

Please sign in to comment.