From 781683a9985fd30128f26a7a820dd1085e02546e Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Sat, 28 Nov 2020 22:11:33 +0000 Subject: [PATCH 1/4] Added a tip about how to run the provisioning from within the VM --- README.md | 13 +++++++ .../roles/jotbe.dev-tools/tasks/main.yml | 39 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 provisioning/roles/jotbe.dev-tools/tasks/main.yml diff --git a/README.md b/README.md index f19a321..fbb9694 100644 --- a/README.md +++ b/README.md @@ -96,3 +96,16 @@ Vagrant will bootstrap a VM, install Ansible und run the provisioning from withi ## Default user By default, a `vagrant` user will be provisioned (if not already available) and used throughout the provisioning. The default password is `vagrant`. + +## Tips + +### Run the provisioning from within the VM on demand + +Open a terminal and run: + +``` +ansible-playbook -i /vagrant/provisioning/inventory.sample /vagrant/provisioning/playbook.yml -c local +``` + +This will not try to connect to itself via SSH using the defined IP address but instead uses the local connection. + diff --git a/provisioning/roles/jotbe.dev-tools/tasks/main.yml b/provisioning/roles/jotbe.dev-tools/tasks/main.yml new file mode 100644 index 0000000..16a83f4 --- /dev/null +++ b/provisioning/roles/jotbe.dev-tools/tasks/main.yml @@ -0,0 +1,39 @@ +--- +# tasks file for jotbe.dev-tools + +- name: Add key for Sublime Text repo + apt_key: + url: https://download.sublimetext.com/sublimehq-pub.gpg + state: present + +- name: Add repository for Sublime Text + apt_repository: + repo: deb https://download.sublimetext.com/ apt/stable/ + state: present + +- name: Add key for VSCodium repo + apt_key: + url: https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg + state: present + +- name: Add repository for VSCodium + apt_repository: + repo: deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main + state: present + +- name: Update apt cache + apt: + update_cache: yes + cache_valid_time: 7200 + +- name: Install Sublime Text + apt: + pkg: + - sublime-text + register: sublime_text_installed + +- name: Install VSCodium + apt: + pkg: + - codium + register: vscodium_installed From 609ac2c3fa3526158cf417dc80320ef83a26b421 Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Sat, 28 Nov 2020 22:38:36 +0000 Subject: [PATCH 2/4] Fixed roles path option in ansible.cfg --- provisioning/ansible.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provisioning/ansible.cfg b/provisioning/ansible.cfg index 71b7dad..34cd392 100644 --- a/provisioning/ansible.cfg +++ b/provisioning/ansible.cfg @@ -2,7 +2,7 @@ gathering = smart fact_caching_connection = ./facts_cache fact_caching = jsonfile -ansible_roles_path = ./roles +roles_path = ./roles # The timeout is defined in seconds # This is 2 hours @@ -11,4 +11,4 @@ fact_caching_timeout = 7200 [ssh_connection] ssh_args = -o ControlMaster=auto -o ControlPersist=18000 -o PreferredAuthentications=publickey control_path = %(directory)s/ansible-ssh-%%h-%%p-%%r -pipelining = True \ No newline at end of file +pipelining = True From 18f196a8e0b0a1c781dd5898365c582f1a4309fc Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Sun, 29 Nov 2020 11:08:38 +0000 Subject: [PATCH 3/4] Added tip about how to keep Virtualbox Guest Additions automatically up to date with Vagrant --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fbb9694..9eac59d 100644 --- a/README.md +++ b/README.md @@ -107,5 +107,12 @@ Open a terminal and run: ansible-playbook -i /vagrant/provisioning/inventory.sample /vagrant/provisioning/playbook.yml -c local ``` -This will not try to connect to itself via SSH using the defined IP address but instead uses the local connection. +This will not try to connect to itself via SSH using the defined IP address but instead uses the local connection. +### Keep the Virtualbox Guest Additions up to date with Vagrant + +Install the Vagrant plugin `vagrant-vbguest`: + +``` +vagrant plugin install vagrant-vbguest +``` \ No newline at end of file From 6d820db7f588756029c6cb42f200309aaf6cecab Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Sun, 29 Nov 2020 20:05:05 +0000 Subject: [PATCH 4/4] Use jotbe.common and jotbe.dev-tools roles, removed now obsolete tasks --- provisioning/playbook.yml | 36 +++-------------------------------- provisioning/requirements.yml | 5 +++++ 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index d71f855..378624a 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -3,10 +3,6 @@ become: yes vars: - locales_gen: - - en_US.UTF-8 - - de_DE.UTF-8 - locales_default: de_DE.UTF-8 ansible_version: "2.9.4" pip_install_packages: - name: docker @@ -20,34 +16,6 @@ - vagrant pre_tasks: - - name: Generate locals - locale_gen: - name: "{{ item }}" - state: present - loop: "{{ locales_gen }}" - - - name: Get current locale - command: localectl status - register: locale_status - changed_when: false - - - name: Extract LANG from current locale configuration - set_fact: - locale_lang: "{{ locale_status.stdout | regex_search('LANG=([^\n]+)', '\\1') | first }}" - - - debug: - msg: "{{ locale_lang }}" - - - name: Set default locale - command: localectl set-locale LANG={{ locales_default }} - when: locale_lang != locales_default - - - name: Replace US repo with DE mirror - replace: - path: /etc/apt/sources.list - regexp: 'us(\.archive\.ubuntu\.com)' - replace: 'de\1' - - name: Install Python3 raw: test -e /usr/bin/python3 || (apt update && apt install -y --force-yes python3) changed_when: false @@ -97,5 +65,7 @@ when: desktop_installed.changed roles: + - jotbe.common - geerlingguy.pip - - geerlingguy.docker \ No newline at end of file + - geerlingguy.docker + - jotbe.dev-tools \ No newline at end of file diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index a0570a7..83666ca 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -5,3 +5,8 @@ - name: jotbe.common src: https://git.jotbe.io/jotbe/ansible-role-common.git scm: git + +- name: jotbe.dev-tools + src: https://git.jotbe.io/jotbe/ansible-role-dev-tools.git + scm: git +