Ansible
簡介
Ansible是一套軟體工具,其可實現基礎架構即程式碼。它是開源的,並且該套件包括軟體供應、組態管理和應用程式部署等功能。 Ansible 最初由 Michael DeHaan 編寫,並於 2015 年被Red Hat收購,其旨在自動化設定類 Unix系統和Microsoft Windows 的環境。
Links
- Ansible Community
- How to Test Ansible Roles with Molecule and Docker
- Red Hat Ansible Automation Platform
- Ansible Galaxy
Commands
# 列出 lookup 可用的 plugins
# Usage:
# motd_value: "{{ lookup('file', '/etc/motd') }}"
ansible-doc -l -t lookup
Installation
RedHat 8.7
相依性套件
dnf update
reboot
dnf install ansible-core openssl-libs
dnf group install "Development Tools"
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install python39-setuptools_scm
AWX
git clone -b 22.3.0 https://github.com/ansible/awx.git
cd awx
vi tools/docker-compose/inventory
make docker-compose-build
cp Makefile{,.orig}
sed -i 's/^\(DOCKER_COMPOSE ?=\).*/\1 docker compose/' Makefile
make docker-compose
AWX Web UI: https://server.ip.adress:8043/
網頁顯示錯誤訊息:
<% if (process.env.NODE_ENV === 'production') { %> <% } %> <% if (process.env.NODE_ENV === 'production') { %> <% } else { %> <% } %> <% if (process.env.NODE_ENV === 'production') { %>
Clean and build the UI
docker exec tools_awx_1 make clean-ui ui-devel
輸出內容停在以下訊息
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
Ctrl + C 離開
docker exec -it tools_awx_1 bash
> cd /awx_devel/awx/ui
> npx update-browserslist-db@latest
> exit
再執行一次
docker exec tools_awx_1 make clean-ui ui-devel