Skip to content

Commit

Permalink
Fix: ansible roles were fixed (#1320)
Browse files Browse the repository at this point in the history
* fix: update pyenv role to something not broken

* fix: pin the correct version of compose on ansible role misbehaviour

somehow you gotta specify the default value of docker_install_compose, and absolutely avoid to install the plugin (which by default should be like this, but is not)

* chore: fix yamllint
  • Loading branch information
linuxbandit committed Jun 2, 2024
1 parent 17415bb commit 6acb700
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 deletions.
18 changes: 16 additions & 2 deletions scripts-vagrant_provision/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@ npm_version: "9.6.4"

python_version: "3.10.3"

docker_version: "19.03.5"
docker_version: "19.03.15"
docker_ubuntu_version: "5:{{ docker_version }}~3-0~ubuntu-bionic"
docker_compose_version: "1.24.0"
docker_compose_version: "1.29.2"
docker_users: ["vagrant"]

docker_install_compose: true
docker_compose_package_state: absent

docker_packages:
- "docker-{{ docker_edition }}={{docker_ubuntu_version}}"
- "docker-{{ docker_edition }}-cli={{docker_ubuntu_version}}"
# - "docker-{{ docker_edition }}-rootless-extras={{docker_ubuntu_version}}"
docker_daemon_options:
log-driver: "json-file"
log-opts:
max-size: "10m"
max-file: "2"
labels: "host-{{ ansible_hostname }}"

packages_to_install: ['make', 'jq', 'net-tools', 'vim', 'sqlite3', 'cowsay', 'figlet']
32 changes: 15 additions & 17 deletions scripts-vagrant_provision/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@

---

- name: Upgrade apt cache
hosts: all
become: true
tags: ['pyenv', 'node', 'docker', 'packages'] # before any task

pre_tasks:
- name: Update apt-cache
apt:
update_cache: yes
cache_valid_time: 36000

- name: Prerequisites - folders
hosts: all
become: yes
Expand Down Expand Up @@ -54,8 +65,7 @@
- npm
when: current_node_version.stdout != nodejs_version

- name: Install pyenv with better role but possibly with a deprecation inside
# TODO: pyenv role uses deprecated stuff?
- name: Prerequisites - python
hosts: all
tags: ['pyenv']

Expand All @@ -69,11 +79,11 @@
ignore_errors: yes

roles:
- role: avanov.pyenv
- role: staticdev.pyenv
vars:
pyenv_path: "{{ ansible_env.HOME }}/.pyenv"
pyenv_python_versions: ["{{ python_version }}"]
pyenv_global: "{{ python_version }}"
pyenv_global: ["{{ python_version }}"]
pyenv_virtualenvs:
- venv_name: "notifications"
py_version: "{{ python_version }}"
Expand All @@ -85,7 +95,7 @@
# pip:
# requirements: /vagrant/scripts-vagrant_provision/requirements.txt

- name: Prerequisites - node/python itself
- name: Prerequisites - node
hosts: all
become: no # role asked so
tags: ['node']
Expand All @@ -105,18 +115,6 @@
become: true
tags: ['docker']

vars:
docker_packages:
- "docker-{{ docker_edition }}={{docker_ubuntu_version}}"
- "docker-{{ docker_edition }}-cli={{docker_ubuntu_version}}"
# - "docker-{{ docker_edition }}-rootless-extras={{docker_ubuntu_version}}"
docker_daemon_options:
log-driver: "json-file"
log-opts:
max-size: "10m"
max-file: "2"
labels: "host-{{ ansible_hostname }}"

roles:
- geerlingguy.docker

Expand Down
6 changes: 3 additions & 3 deletions scripts-vagrant_provision/requirements-ansible.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: geerlingguy.docker
version: '6.1.0'
version: '7.1.0'
- name: morgangraphics.ansible_role_nvm
version: 'v2.0.0'
- name: avanov.pyenv
version: '1.1.0'
- name: staticdev.pyenv
version: '2.11.0'

0 comments on commit 6acb700

Please sign in to comment.