Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a606747

Browse files
author
Michael Bushey
committedAug 28, 2020
Fix Image tag and clean up ansible
1 parent 839e56a commit a606747

File tree

4 files changed

+46
-75
lines changed

4 files changed

+46
-75
lines changed
 

‎Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Re-use the phusion baseimage which runs an SSH server etc
2-
FROM phusion/baseimage
2+
FROM phusion/baseimage:master-amd64
33

44
# Some definitions
55
ENV SUDOFILE /etc/sudoers
@@ -29,16 +29,15 @@ RUN \
2929
chown -R vagrant:vagrant /home/vagrant/.ssh && \
3030
# Update apt-cache, so that stuff can be installed \
3131
# Install python (otherwise ansible will not work) \
32-
# Install aptitude, since ansible needs it (only apt-get is installed) \
3332
apt-get -y update && \
34-
apt-get -y install sudo python python-dev python-pip aptitude && \

Comment on line R34

mabushey commented on Aug 28, 2020

@mabushey

I don't think ansible has ever supported aptitude, it's more of a user friendly front end to apt.

Code has comments. Press enter to view.
33+
apt-get -y install sudo python3 python3-dev python3-pip && \
3534
# Enable password-less sudo for all user (including the 'vagrant' user) \
3635
chmod u+w ${SUDOFILE} && \
3736
echo '%sudo ALL=(ALL:ALL) NOPASSWD: ALL' >> ${SUDOFILE} && \
3837
chmod u-w ${SUDOFILE} && \
3938
apt-get clean && \
4039
# install ansible
41-
pip install ansible && \
40+
pip3 install ansible && \
4241
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
4342
# we put the 'last time apt-get update was run' file far in the past \
4443
# so that ansible can then re-run apt-get update \
Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,41 @@
11
---
2-
- name: Add neovim ppa
3-
apt_repository: repo="ppa:neovim-ppa/stable" state=present
2+
- name: Add neovim ppa
3+
apt_repository: repo="ppa:neovim-ppa/stable" state=present
44

5-
- name: Install neovim from ppa
6-
apt: name="neovim" state="present"
5+
- name: Install neovim from ppa
6+
apt: name="neovim" state="present"
77

8-
# install vim-plug
8+
- name: Install vim-plug
9+
block:
10+
- name: Make "{{ neovim_config_dir }}/autoload" directory
11+
file: path="{{ neovim_config_dir }}/autoload" state=directory
912

10-
- name: Make "{{ neovim_config_dir }}/autoload" directory
11-
file: path="{{ neovim_config_dir }}/autoload" state=directory
12-
become: yes
13-
become_user: vagrant
13+
- name: Make "{{ neovim_data_dir }}/plugged" directory
14+
file: path="{{ neovim_data_dir }}/plugged" state=directory
1415

15-
- name: Make "{{ neovim_data_dir }}/plugged" directory
16-
file: path="{{ neovim_data_dir }}/plugged" state=directory
17-
become: yes
18-
become_user: vagrant
16+
- name: Install vim-plug
17+
get_url:
18+
url: " https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
19+
dest: "{{ neovim_config_dir }}/autoload/plug.vim"
20+
mode: 0700
1921

20-
- name: Install vim-plug
21-
get_url:
22-
url: " https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
23-
dest: "{{ neovim_config_dir }}/autoload/plug.vim"
24-
become: yes
25-
become_user: vagrant
22+
become: yes
23+
become_user: vagrant
2624

2725
# install deoplete

Comment on line R25

mabushey commented on Aug 28, 2020

@mabushey

This is NOT installing deoplete, it's installing neovim again via pip3, it was previously (line 6) installed via apt from the ppa.

Code has comments. Press enter to view.
28-
29-
- name: Installing neovim pip3 package
30-
command: pip3 install neovim
26+
- name: Installing neovim pip3 package
27+
command: pip3 install neovim
3128

3229
# Copy the init file
33-
- name: copy init files in rc folder
34-
copy:
35-
src="init.vim"
36-
dest="{{ neovim_config_dir }}/init.vim"
37-
owner="{{ username }}"
38-
group="{{ username }}"
39-
mode=0640
40-
41-
# install vim plugins
42-
- name: Install vim plugins
43-
command: nvim '+silent!' '+PlugInstall!' '+qall!'
44-
become: yes
45-
become_user: vagrant
30+
- name: copy init files in rc folder
31+
copy:
32+
src="init.vim"
33+
dest="{{ neovim_config_dir }}/init.vim"
34+
owner="{{ username }}"
35+
group="{{ username }}"
36+
mode=0640
37+
38+
- name: Install vim plugins
39+
command: nvim '+silent!' '+PlugInstall!' '+qall!'
40+
become: yes
41+
become_user: vagrant
Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
---
2-
2+
- block:
33
- name: download rustup
44
get_url:
55
url: "https://sh.rustup.rs"
66
dest: "/tmp/rustup.sh"
77
validate_certs: False
8-
become: yes
9-
become_user: vagrant
8+
mode: 0700
109

1110
- name: install rustup and rust nightly
1211
command: "sh /tmp/rustup.sh --default-toolchain nightly -y"
13-
become: yes
14-
become_user: vagrant
1512

1613
- name: install rust language server (rls)
1714
command: /home/vagrant/.cargo/bin/rustup component add rls-preview
18-
become: yes
19-
become_user: vagrant
2015

2116
- name: install rust sources for racer
2217
command: /home/vagrant/.cargo/bin/rustup component add rust-src
23-
become: yes
24-
become_user: vagrant
2518

2619
- name: install rust analysis
2720
command: /home/vagrant/.cargo/bin/rustup component add rust-analysis
28-
become: yes
29-
become_user: vagrant
3021

3122
- name: install racer (take ~20 minutes)
3223
command: /home/vagrant/.cargo/bin/cargo install racer
33-
become: yes
34-
become_user: vagrant
24+
25+
become: yes
26+
become_user: vagrant

‎provisioning/site.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,13 @@
88
document_root: "/{{ username }}"
99

1010
pre_tasks:
11-
- name: Install stuff from Aptitude
12-
apt:
13-
name="{{ item }}"
14-
state=present
15-
update_cache=yes
16-
cache_valid_time=86400
17-
with_items:
18-
- sudo
19-
- git
20-
- tig
21-
- vim
22-
- gcc
23-
- gdb
24-
- bash-completion # Not included in the docker image
25-
- make
26-
- tree
27-
- htop
28-
- man-db
29-
- software-properties-common
30-
- python-dev
31-
- python-pip
32-
- python3-dev
33-
- python3-pip
11+
- name: Install from Apt
12+
apt:
13+
# bash-completion is not in phusion
14+
name: ['sudo', 'git', 'tig', 'vim', 'gcc', 'gdb', 'bash-completion', 'make', 'tree', 'htop', 'man-db', 'software-properties-common', 'python3-dev', 'python3-pip']

Comment on line R14

mabushey commented on Aug 28, 2020

@mabushey

New Ansible format, this avoids a warning.

Code has comments. Press enter to view.
15+
state: present
16+
update_cache: yes
17+
cache_valid_time: 14400 # 4 hours
3418

3519
roles:
3620
- rust

0 commit comments

Comments
 (0)
Please sign in to comment.