Skip to content

Commit

Permalink
Provisioning: apt & pip packages
Browse files Browse the repository at this point in the history
  • Loading branch information
thsur committed Mar 20, 2021
1 parent a5cd4ce commit abb790e
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

/user/*
!/user/.gitkeep

tmp/

# Ansible
Expand Down
11 changes: 7 additions & 4 deletions Rakefile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def generate_ansible_files
end

desc 'Pause dev machine.'
task :halt do
task :suspend do
cd('vagrant') do
sh 'vagrant suspend'
end
Expand Down Expand Up @@ -236,11 +236,15 @@ def generate_ansible_files
desc = {}

puts
puts 'VM'
puts '=' * 40
puts '|' << ' ' * 38 << '|'
puts '|' << ' ' * 16 << 'DevOps' << ' ' * 16 << '|'
puts '|' << ' ' * 38 << '|'
puts '=' * 40
puts
puts 'Usage:'
puts 'rake TASK, e.g. rake ' + tasks[0].name
puts
puts

tasks.each do |t|

Expand All @@ -257,7 +261,6 @@ def generate_ansible_files

title = "* #{ns.upcase} *"

puts
puts "-" * title.length
puts title
puts "-" * title.length
Expand Down
4 changes: 2 additions & 2 deletions ansible/plays/provision/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
name: common
- include_role:
name: geerlingguy.firewall
- include_role:
name: geerlingguy.pip
# - include_role:
# name: geerlingguy.pip
# - include_role:
# name: geerlingguy.memcached
# - include_role:
Expand Down
25 changes: 13 additions & 12 deletions ansible/plays/provision/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,23 @@ composer_global_packages:
#
# apt
#
apt_extra_ppa:
# Ubuntu 14 comes with Apache 2.4.7, but we need at least Apache 2.4.9
# for PHP-FPM with SetHandler (see below) to work, so we need to install
# an extra PPA.
- "ppa:ondrej/apache2"

apt_extra_ppa: []

apt_extra_packages:
- silversearcher-ag
- python3-pip
- aptitude
- apache2
- sqlite
- unzip

#
# Python packages
#
pip_extra_packages:
- virtualenv
- pyopenssl

#
# MySQL
#
Expand All @@ -65,12 +72,6 @@ mysql_slow_query_log_enabled: true
mysql_slow_query_time: 2
mysql_wait_timeout: 300

#
# Python packages
#
pip_install_packages:
- pyopenssl

#
# Apache
#
Expand Down
1 change: 0 additions & 1 deletion ansible/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
- src: geerlingguy.apache-php-fpm
- src: geerlingguy.composer
- src: geerlingguy.firewall
- src: geerlingguy.pip
- src: geerlingguy.mysql
- src: geerlingguy.mailhog
- src: weareinteractive.environment
Expand Down
32 changes: 15 additions & 17 deletions ansible/roles/custom/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,33 @@
with_items: "{{ apt_extra_ppa }}"
when: apt_extra_ppa | length

# Install default packages
# Keep apt packages up to date

- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 86400 # twenty-four hours

- name: Install Nano
- name: Upgrade apt packages
apt:
name: nano
state: present

- name: Install Silver Searcher (ag)
apt:
name: silversearcher-ag
state: present

- name: Install Git
apt:
name: git
state: present
upgrade: safe

# Install extra packages

- name: Install extra apt packages
apt: "name={{ apt_extra_packages | list }} state=present"
apt:
pkg: "{{ apt_extra_packages }}"
when: apt_extra_packages | length

# Install extra Python packages

- name: Install extra pip packages
pip:
name: "{{ pip_extra_packages }}"

# Generate language file

- name: Install language(s)
command: "locale-gen de_DE.UTF-8"
- name: Install locale(s)
locale_gen:
name: de_DE.UTF-8
state: present
Empty file added user/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion vagrant/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ ip: 0.0.0.0 # Auto-configure a guest's ip. Requires www-data-auto_network.
# Change to some address from the private address space to give it a fixed ip (like '192.168.0.99').

box:
type: bento/ubuntu-16.04 # Cf. https://www.vagrantup.com/docs/boxes#official-boxes
type: bento/ubuntu-20.10 # Cf. https://www.vagrantup.com/docs/boxes#official-boxes
memory: 2048
cpus: 1

0 comments on commit abb790e

Please sign in to comment.