Skip to content

Commit

Permalink
Updated docker in provisioning script + some additional fixes (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSkierniewski committed Oct 10, 2017
1 parent 829f71e commit bdd8ee3
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 14 deletions.
8 changes: 7 additions & 1 deletion ansible/group_vars/all
@@ -1,12 +1,18 @@
---
ansible_user: root
ansible_port: 22
ag_motd_info:
- " FQDN: ": "{{ inventory_hostname }}"
- " Distro: ": "{{ ansible_distribution }} {{ ansible_distribution_version }} {{ ansible_distribution_release }}"
- " Virtual: ": "{{ 'YES' if ansible_virtualization_role == 'guest' else 'NO' }}\n"
- " CPUs: ": "{{ ansible_processor_vcpus }}"
- " RAM: ": "{{ (ansible_memtotal_mb / 1000) | round(1) }}GB"
ag_motd_content: |
--------------------------------------------------------------------------
This system is managed by Ansible
--------------------------------------------------------------------------

This is {{ ansible_fqdn }} running {{ ansible_distribution }}.
This is {{ inventory_hostname_short }} running {{ ansible_distribution }}.

NOTE: System and application configuration for this host is managed by
automated systems. To ensure that any changes you make here are not lost,
Expand Down
2 changes: 1 addition & 1 deletion ansible/production
@@ -1,2 +1,2 @@
[webservers]
web1 ansible_host=app1.grupazero.pl ansible_fqdn=app1.grupazero.pl
test1.grupazero.pl ansible_host=vps261700.grupazero.pl
35 changes: 30 additions & 5 deletions ansible/provision.yml
Expand Up @@ -21,7 +21,7 @@
- git
tags: [zsh]
- role: angstwad.docker_ubuntu
docker_pkg_name: docker-engine=1.13.1-0~ubuntu-xenial
uninstall_previous_docker_versions: true
tags: [docker]
- role: kamaln7.swapfile
swapfile_use_dd: true
Expand All @@ -30,10 +30,7 @@
swapfile_vfs_cache_pressure: 50
swapfile_location: /swapfile
tags: [swap]
- role: holms.fqdn
fqdn: "{{ ansible_fqdn }}"
hostname: "{{ inventory_hostname_short }}"
when: ansible_fqdn is defined
- role: ANXS.hostname
tags: [fqdn]
- role: adriagalin.motd
tags: [motd]
Expand All @@ -51,6 +48,34 @@
tags: [postgres]

tasks:
- name: Update all packages to the latest version
apt:
upgrade: dist
- name: Add FQDN to zsh
lineinfile:
dest: /root/.zshrc
regexp: "^HOST="
line: "HOST=$(hostname -f)"
state: present
- name: Use FQDN in oh my zsh theme
replace:
path: .oh-my-zsh/themes/gianu.zsh-theme
regexp: '}%m%{'
replace: '}%M%{'
- name: Disable APT::Periodic::Unattended-Upgrade
lineinfile:
dest: /etc/apt/apt.conf.d/20auto-upgrades
regexp: "^APT::Periodic::Unattended-Upgrade"
line: 'APT::Periodic::Unattended-Upgrade "0";'
state: present
- name: Enable some kernel modules for Docker
lineinfile:
dest: /etc/default/grub
regexp: "^GRUB_CMDLINE_LINUX="
line: 'GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"'
state: present
- name: 'Update GRUB config'
shell: update-grub
- name: 'Install common stuff'
apt:
name: htop
Expand Down
12 changes: 6 additions & 6 deletions ansible/roles.txt
@@ -1,6 +1,6 @@
kamaln7.swapfile,master
holms.fqdn,1.1
angstwad.docker_ubuntu,v2.2
adriagalin.motd,1.1.1
gantsign.oh-my-zsh,1.2.0
ANXS.postgresql,v1.7.1
- kamaln7.swapfile, master
- angstwad.docker_ubuntu, v3.2.0
- adriagalin.motd, 1.1.1
- gantsign.oh-my-zsh, 1.2.1
- ANXS.hostname, v1.1.0
- ANXS.postgresql, v1.9.0
2 changes: 1 addition & 1 deletion ansible/staging
@@ -1,2 +1,2 @@
[webservers]
staging1 ansible_host=staging1.grupazero.pl ansible_fqdn=staging1.grupazero.pl
staging1.grupazero.pl

0 comments on commit bdd8ee3

Please sign in to comment.