From 660944ae2195851c00270c7f1d038fb78a213ec6 Mon Sep 17 00:00:00 2001 From: TS <5197147+seoulplane@users.noreply.github.com> Date: Mon, 5 Oct 2026 00:25:51 -0400 Subject: [PATCH 1/3] Add draft Ansible control node container script --- ct/ansible.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 ct/ansible.sh diff --git a/ct/ansible.sh b/ct/ansible.sh new file mode 100644 index 0000000000..2759ba99ab --- /dev/null +++ b/ct/ansible.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: proxmox-helper +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/ansible/ansible + +APP="Ansible" +var_tags="${var_tags:-automation;ansible}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" +#var_arm64="${var_arm64:-no}" # unset: this script has not been tested on arm64 + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -x /opt/ansible/ansible/bin/ansible ]]; then + msg_error "No Ansible Installation Found!" + exit 1 + fi + + create_backup /etc/ansible /opt/ansible-data + PYTHON_VERSION="3.13" setup_uv + + # The community package is published on PyPI; GitHub releases track ansible-core. + msg_info "Updating Ansible" + export UV_TOOL_DIR="/opt/ansible" + export UV_TOOL_BIN_DIR="/usr/local/bin" + $STD uv tool upgrade --python 3.13 ansible + $STD /usr/local/bin/ansible --version + msg_ok "Updated Ansible" + + restore_backup + msg_ok "Updated Ansible successfully!" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}Ansible setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}Open the container console and run: ansible localhost -m ansible.builtin.ping${CL}" +echo -e "${INFO}${YW}Ansible inventory: /etc/ansible/hosts; playbooks: /opt/ansible-data/playbooks${CL}" From 45b3f7f5891e23043c91d66a4756c4854efe3b2d Mon Sep 17 00:00:00 2001 From: TS <5197147+seoulplane@users.noreply.github.com> Date: Mon, 5 Oct 2026 00:37:21 -0400 Subject: [PATCH 2/3] Add install/ansible-install.sh to complete Ansible script structure --- install/ansible-install.sh | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 install/ansible-install.sh diff --git a/install/ansible-install.sh b/install/ansible-install.sh new file mode 100644 index 0000000000..e14982f0ea --- /dev/null +++ b/install/ansible-install.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: proxmox-helper +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/ansible/ansible + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Ansible Dependencies" +$STD apt install -y openssh-client git +msg_ok "Installed Ansible Dependencies" + +PYTHON_VERSION="3.13" setup_uv + +msg_info "Installing Ansible" +export UV_TOOL_DIR="/opt/ansible" +export UV_TOOL_BIN_DIR="/usr/local/bin" +$STD uv tool install --python 3.13 --with-executables-from ansible-core ansible +$STD /usr/local/bin/ansible --version +msg_ok "Installed Ansible" + +msg_info "Configuring Ansible" +mkdir -p /etc/ansible /opt/ansible-data/playbooks /opt/ansible-data/roles /opt/ansible-data/collections +chmod 700 /etc/ansible /opt/ansible-data +cat <<'EOF' >/etc/ansible/ansible.cfg +[defaults] +inventory = /etc/ansible/hosts +roles_path = /opt/ansible-data/roles +collections_path = /opt/ansible-data/collections +host_key_checking = True +EOF +cat <<'EOF' >/etc/ansible/hosts +[local] +localhost ansible_connection=local ansible_python_interpreter=/opt/ansible/ansible/bin/python + +# Add managed hosts in separate groups, for example: +# [servers] +# server1 ansible_host=192.0.2.10 ansible_user=automation +EOF +chmod 600 /etc/ansible/ansible.cfg /etc/ansible/hosts +msg_ok "Configured Ansible" + +msg_info "Verifying Ansible" +$STD /usr/local/bin/ansible localhost -m ansible.builtin.ping +msg_ok "Verified Ansible" + +motd_ssh +customize +cleanup_lxc From b7c3d6507bd7c542159a4bf9dbfaec6691c83336 Mon Sep 17 00:00:00 2001 From: TS <5197147+seoulplane@users.noreply.github.com> Date: Mon, 5 Oct 2026 00:37:24 -0400 Subject: [PATCH 3/3] Add json/ansible.json to complete Ansible script structure --- json/ansible.json | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 json/ansible.json diff --git a/json/ansible.json b/json/ansible.json new file mode 100644 index 0000000000..4ec4ea6fe6 --- /dev/null +++ b/json/ansible.json @@ -0,0 +1,40 @@ +{ + "name": "Ansible", + "slug": "ansible", + "categories": [19], + "date_created": "2026-10-05", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": null, + "documentation": "https://docs.ansible.com/", + "website": "https://www.ansible.com/", + "repository": "https://github.com/ansible/ansible", + "platforms": ["pve"], + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/ansible.webp", + "description": "Ansible automation control node with ansible-core and the community collection bundle, installed in an isolated uv environment.", + "install_methods": [ + { + "type": "default", + "script": "ct/ansible.sh", + "config_path": "/etc/ansible/ansible.cfg", + "resources": { + "cpu": 2, + "ram": 1024, + "hdd": 8, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + {"text": "Command-line control node; use the container console. No web interface or application daemon.", "type": "info"}, + {"text": "Inventory is /etc/ansible/hosts. Store playbooks and custom roles or collections in /opt/ansible-data.", "type": "info"}, + {"text": "Updates install the latest compatible stable Ansible package from PyPI. Review Ansible porting guides before upgrading.", "type": "info"}, + {"text": "Proxmox installation and arm64 support have not yet been tested.", "type": "warning"} + ] +}