feat(playbooks): rename root authorized key bootstrap playbook
This commit is contained in:
parent
3a7e30971a
commit
f7a627673a
@ -5,8 +5,8 @@
|
|||||||
become: yes
|
become: yes
|
||||||
vars:
|
vars:
|
||||||
# Choose Node.js version
|
# Choose Node.js version
|
||||||
# Examples: "20.x" (LTS), "18.x", "22.x", or specific version like "20.11.0"
|
# Examples: "22.x" (LTS), "20.x", "18.x", or specific version like "20.11.0"
|
||||||
nodejs_version: "20.x"
|
nodejs_version: "22.x"
|
||||||
|
|
||||||
# Install Yarn package manager (default: true)
|
# Install Yarn package manager (default: true)
|
||||||
# install_yarn: false
|
# install_yarn: false
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# Node.js version to install (LTS or specific version)
|
# Node.js version to install (LTS or specific version)
|
||||||
# Examples: "20.x", "18.x", "20.11.0", "20.19.6"
|
# Examples: "22.x", "20.x", "18.x", "20.11.0", "20.19.6"
|
||||||
nodejs_version: "20.x"
|
nodejs_version: "22.x"
|
||||||
|
|
||||||
# Install Yarn package manager (default: true)
|
# Install Yarn package manager (default: true)
|
||||||
install_yarn: true
|
install_yarn: true
|
||||||
|
|||||||
@ -78,11 +78,11 @@
|
|||||||
update_cache: yes
|
update_cache: yes
|
||||||
when: nodejs_needs_install | default(true)
|
when: nodejs_needs_install | default(true)
|
||||||
|
|
||||||
- name: Install npm globally
|
- name: Verify npm is available
|
||||||
npm:
|
command: npm --version
|
||||||
name: npm
|
register: npm_version_check
|
||||||
state: latest
|
changed_when: false
|
||||||
global: yes
|
failed_when: false
|
||||||
|
|
||||||
- name: Get current Yarn version
|
- name: Get current Yarn version
|
||||||
command: yarn --version
|
command: yarn --version
|
||||||
@ -159,5 +159,5 @@
|
|||||||
debug:
|
debug:
|
||||||
msg: |
|
msg: |
|
||||||
Node.js version: {{ nodejs_installed_version | default('Not installed') }}
|
Node.js version: {{ nodejs_installed_version | default('Not installed') }}
|
||||||
NPM version: {{ ansible_facts.packages.npm[0].version if ansible_facts.packages.npm is defined and ansible_facts.packages.npm else 'N/A' }}
|
NPM version: {{ npm_version_check.stdout if npm_version_check.rc == 0 else 'N/A' }}
|
||||||
Yarn version: {{ yarn_version_check.stdout if yarn_version_check.rc == 0 and install_yarn | default(true) else 'Not installed' }}
|
Yarn version: {{ yarn_version_check.stdout if yarn_version_check.rc == 0 and install_yarn | default(true) else 'Not installed' }}
|
||||||
|
|||||||
9
roles/vhosts/python3/README.md
Normal file
9
roles/vhosts/python3/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# python3
|
||||||
|
|
||||||
|
Minimal Python 3 toolchain role for Debian-based hosts.
|
||||||
|
|
||||||
|
Installs:
|
||||||
|
|
||||||
|
- `python3`
|
||||||
|
- `python3-pip`
|
||||||
|
- `python3-venv`
|
||||||
6
roles/vhosts/python3/defaults/main.yml
Normal file
6
roles/vhosts/python3/defaults/main.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
python3_packages:
|
||||||
|
- python3
|
||||||
|
- python3-pip
|
||||||
|
- python3-venv
|
||||||
|
python3_install_recommends: false
|
||||||
26
roles/vhosts/python3/tasks/main.yml
Normal file
26
roles/vhosts/python3/tasks/main.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure Python 3 toolchain is installed
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: "{{ python3_packages }}"
|
||||||
|
state: present
|
||||||
|
install_recommends: "{{ python3_install_recommends }}"
|
||||||
|
update_cache: true
|
||||||
|
environment:
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
APT_LISTCHANGES_FRONTEND: none
|
||||||
|
become: true
|
||||||
|
when:
|
||||||
|
- ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
|
- name: Verify Python 3 installation
|
||||||
|
ansible.builtin.command: python3 --version
|
||||||
|
register: python3_version_check
|
||||||
|
changed_when: false
|
||||||
|
when:
|
||||||
|
- ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
|
- name: Show Python 3 version
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ python3_version_check.stdout }}"
|
||||||
|
when:
|
||||||
|
- ansible_facts.os_family == "Debian"
|
||||||
@ -1,5 +1,6 @@
|
|||||||
- name: Setup Docker Engine
|
- name: Setup Node.js
|
||||||
hosts: all
|
hosts: all
|
||||||
become: true
|
become: true
|
||||||
|
gather_facts: true
|
||||||
roles:
|
roles:
|
||||||
- roles/vhosts/nodejs/
|
- roles/vhosts/nodejs/
|
||||||
|
|||||||
7
setup-python3.yml
Normal file
7
setup-python3.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: Setup Python 3
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
gather_facts: true
|
||||||
|
roles:
|
||||||
|
- roles/vhosts/python3/
|
||||||
Loading…
Reference in New Issue
Block a user