diff --git a/README.md b/README.md index 9eac59d..f19a321 100644 --- a/README.md +++ b/README.md @@ -96,23 +96,3 @@ 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. - -### 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 diff --git a/provisioning/ansible.cfg b/provisioning/ansible.cfg index 34cd392..71b7dad 100644 --- a/provisioning/ansible.cfg +++ b/provisioning/ansible.cfg @@ -2,7 +2,7 @@ gathering = smart fact_caching_connection = ./facts_cache fact_caching = jsonfile -roles_path = ./roles +ansible_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 +pipelining = True \ No newline at end of file diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 378624a..d71f855 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -3,6 +3,10 @@ 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 @@ -16,6 +20,34 @@ - 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 @@ -65,7 +97,5 @@ when: desktop_installed.changed roles: - - jotbe.common - geerlingguy.pip - - geerlingguy.docker - - jotbe.dev-tools \ No newline at end of file + - geerlingguy.docker \ No newline at end of file diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 83666ca..a0570a7 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -5,8 +5,3 @@ - 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 - diff --git a/provisioning/roles/jotbe.dev-tools/tasks/main.yml b/provisioning/roles/jotbe.dev-tools/tasks/main.yml deleted file mode 100644 index 16a83f4..0000000 --- a/provisioning/roles/jotbe.dev-tools/tasks/main.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -# 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