Updated Ansible scripts, update cleanup script, update README

This commit is contained in:
Moritz Heiber 2017-04-23 13:52:48 +02:00
parent c2a6325849
commit 4a85989bd3
4 changed files with 24 additions and 6 deletions

View File

@ -2,6 +2,8 @@
This VirtualBox base image contains all the required packages and configuration for running/instantiating a Mastodon instance for development. It is build using [Hashicorp's Packer](https://packer.io), the provisioning is done with Ansible through a dedicated git submodule called [mastodon-ansible](https://github.com/moritzheiber/mastodon-ansible). The tests are using [ServerSpec](https://serverspec.org). The image is build continuously using [Hashicorp Atlas](https://atlas.hashicorp.com). This VirtualBox base image contains all the required packages and configuration for running/instantiating a Mastodon instance for development. It is build using [Hashicorp's Packer](https://packer.io), the provisioning is done with Ansible through a dedicated git submodule called [mastodon-ansible](https://github.com/moritzheiber/mastodon-ansible). The tests are using [ServerSpec](https://serverspec.org). The image is build continuously using [Hashicorp Atlas](https://atlas.hashicorp.com).
_Note: Some of the content of the scripts in `scripts/` is borrowed from the [Bento](https://github.com/chef/bento) project._
## Prerequisites (for building on your own) ## Prerequisites (for building on your own)
- VirtualBox >= 5.1.x - VirtualBox >= 5.1.x

@ -1 +1 @@
Subproject commit 378f7d3aab1a724e5e9b53046702fa50a9671694 Subproject commit ce3f40045311ef20b74dc08915348de819012016

View File

@ -22,7 +22,11 @@
{ {
"type": "ansible", "type": "ansible",
"playbook_file": "ansible/playbook.yml", "playbook_file": "ansible/playbook.yml",
"extra_arguments": [ "--extra-vars", "\"mastodon_db_password=CHANGEME mastodon_db_login_unix_socket=/var/run/postgresql\"" ] "extra_arguments": [ "--extra-vars", "mastodon_db_password=CHANGEME" ],
"ansible_env_vars": [
"ANSIBLE_REMOTE_TEMP=\"~/.ansible-tmp\"",
"ANSIBLE_SSH_PIPELINING=True"
]
}, },
{ "type": "shell", { "type": "shell",
"execute_command": "{{ .Vars }} sudo -E -S sh '{{ .Path }}'", "execute_command": "{{ .Vars }} sudo -E -S sh '{{ .Path }}'",

View File

@ -6,12 +6,12 @@ dpkg --list \
| grep 'linux-headers' \ | grep 'linux-headers' \
| xargs apt-get -y purge; | xargs apt-get -y purge;
# Remove specific Linux kernels, such as linux-image-3.11.0-15 but # Remove specific Linux kernels, such as linux-image-3.11.0-15-generic but
# keeps the current kernel and does not touch the virtual packages, # keeps the current kernel and does not touch the virtual packages,
# e.g. 'linux-image-amd64', etc. # e.g. 'linux-image-generic', etc.
dpkg --list \ dpkg --list \
| awk '{ print $2 }' \ | awk '{ print $2 }' \
| grep 'linux-image-[234].*' \ | grep 'linux-image-.*-generic' \
| grep -v `uname -r` \ | grep -v `uname -r` \
| xargs apt-get -y purge; | xargs apt-get -y purge;
@ -21,6 +21,12 @@ dpkg --list \
| grep linux-source \ | grep linux-source \
| xargs apt-get -y purge; | xargs apt-get -y purge;
# delete docs packages
dpkg --list \
| awk '{ print $2 }' \
| grep -- '-doc$' \
| xargs apt-get -y purge;
# Delete X11 libraries # Delete X11 libraries
apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6; apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6;
@ -28,10 +34,16 @@ apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6;
apt-get -y purge ppp pppconfig pppoeconf; apt-get -y purge ppp pppconfig pppoeconf;
# Delete oddities # Delete oddities
apt-get -y purge popularity-contest; apt-get -y purge popularity-contest installation-report command-not-found command-not-found-data friendly-recovery;
apt-get -y autoremove; apt-get -y autoremove;
apt-get -y clean; apt-get -y clean;
# Remove docs
rm -rf /usr/share/doc/*
# Remove caches
find /var/cache -type f -exec rm -rf {} \;
# delete any logs that have built up during the install # delete any logs that have built up during the install
find /var/log/ -name *.log -exec rm -f {} \; find /var/log/ -name *.log -exec rm -f {} \;