目次
文書の過去の版を表示しています。
Ansible
GitHub - gilbarbara/logos: A huge collection of SVG logos
公式: Ansible is Simple IT Automation 翻訳
ソースコード: GitHub - ansible/ansible: Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com. 翻訳
ドキュメント: Ansible Documentation 翻訳
Ansible(アンシブル)は、プロビジョニング、構成管理、アプリケーションのデプロイメント、オーケストレーション、その他多くのITプロセスを自動化する、オープンソースのIT自動化ツールである。他の単純な管理ツールと違い、Ansibleのユーザー (システム管理者、開発者、アーキテクトなど) は、ソフトウェアのインストール、日常的に行うタスクの自動化、インフラストラクチャのプロビジョニング、セキュリティとコンプライアンスの向上、システムへのパッチ適用、組織全体での自動化の共有に、Ansibleの自動化を使用できる。
Ansible (ソフトウェア) - Wikiwand より
インストール
pipx によるインストール
pipx - 分離環境での Python アプリケーションのインストールと実行 が必要である🤔
フルインストール、または、ミニマルインストールの何れかでインストールする。
※以降の手順ではフルインストールを前提にしている。
Ansible のフルインストール
$ pipx install --include-deps ansible
installed package ansible 9.2.0, installed using Python 3.12.1 These apps are now globally available - ansible - ansible-community - ansible-config - ansible-connection - ansible-console - ansible-doc - ansible-galaxy - ansible-inventory - ansible-playbook - ansible-pull - ansible-test - ansible-vault done! ✨ 🌟 ✨
Ansible のミニマルインストール
$ pipx install ansible-core
installed package ansible-core 2.16.3, installed using Python 3.12.1 These apps are now globally available - ansible - ansible-config - ansible-connection - ansible-console - ansible-doc - ansible-galaxy - ansible-inventory - ansible-playbook - ansible-pull - ansible-test - ansible-vault done! ✨ 🌟 ✨
動作確認
$ ansible --version
ansible [core 2.16.3] config file = None configured module search path = ['/home/tomoyan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/tomoyan/.local/share/pipx/venvs/ansible/lib64/python3.12/site-packages/ansible ansible collection location = /home/tomoyan/.ansible/collections:/usr/share/ansible/collections executable location = /home/tomoyan/.local/bin/ansible python version = 3.12.1 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] (/home/tomoyan/.local/share/pipx/venvs/ansible/bin/python) jinja version = 3.1.3 libyaml = True
$ ansible-community --version
Ansible community version 9.2.0
Ansible コマンドのシェル補完を追加
$ pipx inject --include-apps ansible argcomplete
⚠️ Note: activate-global-python-argcomplete was already on your PATH at /usr/bin/activate-global-python-argcomplete ⚠️ Note: python-argcomplete-check-easy-install-script was already on your PATH at /usr/bin/python-argcomplete-check-easy-install-script ⚠️ Note: register-python-argcomplete was already on your PATH at /usr/bin/register-python-argcomplete installed package argcomplete 3.2.2, installed using Python 3.12.1 These apps are now globally available - activate-global-python-argcomplete - ansible - ansible-community - ansible-config - ansible-connection - ansible-console - ansible-doc - ansible-galaxy - ansible-inventory - ansible-playbook - ansible-pull - ansible-test - ansible-vault - python-argcomplete-check-easy-install-script - register-python-argcomplete done! ✨ 🌟 ✨ injected package argcomplete into venv ansible done! ✨ 🌟 ✨
$ bash $ activate-global-python-argcomplete --user
Argcomplete was installed in a virtual environment. Defaulting to user installation. Adding shellcode to /home/tomoyan/.zshenv... Added. Adding shellcode to /home/tomoyan/.bash_completion... Added. Please restart your shell or source the installed file to activate it.
Ansible の特定バージョンをインストールする場合
$ pipx install ansible-core==2.16.3
アンインストールする場合
$ pipx uninstall --include-deps ansible $ pipx uninstall ansible-core
dnf によるインストール
公式: Installing Ansible on Fedora Linux - Installing Ansible on specific operating systems — Ansible Documentation 翻訳
$ sudo dnf install ansible -y
メタデータの期限切れの最終確認: 0:00:21 前の 2024年02月08日 09時28分11秒 に実施しました。 依存関係が解決しました。 ============================================================================================================== パッケージ アーキテクチャー バージョン リポジトリー サイズ ============================================================================================================== インストール: ansible noarch 9.1.0-1.fc39 updates 48 M 依存関係のインストール: ansible-core noarch 2.16.2-2.fc39 updates 3.7 M libdnf5 x86_64 5.1.11-1.fc39 updates 930 k python3-jinja2 noarch 3.1.3-1.fc39 updates 507 k python3-resolvelib noarch 0.5.5-9.fc39 fedora 42 k 弱い依存関係のインストール: python3-libdnf5 x86_64 5.1.11-1.fc39 updates 1.5 M トランザクションの概要 ============================================================================================================== インストール 6 パッケージ ダウンロードサイズの合計: 54 M インストール後のサイズ: 484 M パッケージのダウンロード: (1/6): python3-resolvelib-0.5.5-9.fc39.noarch.rpm 151 kB/s | 42 kB 00:00 (2/6): libdnf5-5.1.11-1.fc39.x86_64.rpm 306 kB/s | 930 kB 00:03 (3/6): python3-jinja2-3.1.3-1.fc39.noarch.rpm 198 kB/s | 507 kB 00:02 (4/6): ansible-core-2.16.2-2.fc39.noarch.rpm 600 kB/s | 3.7 MB 00:06 (5/6): python3-libdnf5-5.1.11-1.fc39.x86_64.rpm 153 kB/s | 1.5 MB 00:09 (6/6): ansible-9.1.0-1.fc39.noarch.rpm 2.0 MB/s | 48 MB 00:24 -------------------------------------------------------------------------------------------------------------- 合計 2.1 MB/s | 54 MB 00:26 トランザクションの確認を実行中 トランザクションの確認に成功しました。 トランザクションのテストを実行中 トランザクションのテストに成功しました。 トランザクションを実行中 準備 : 1/1 インストール中 : python3-jinja2-3.1.3-1.fc39.noarch 1/6 インストール中 : libdnf5-5.1.11-1.fc39.x86_64 2/6 インストール中 : python3-libdnf5-5.1.11-1.fc39.x86_64 3/6 インストール中 : python3-resolvelib-0.5.5-9.fc39.noarch 4/6 インストール中 : ansible-core-2.16.2-2.fc39.noarch 5/6 インストール中 : ansible-9.1.0-1.fc39.noarch 6/6 scriptletの実行中: ansible-9.1.0-1.fc39.noarch 6/6 検証 : python3-resolvelib-0.5.5-9.fc39.noarch 1/6 検証 : ansible-9.1.0-1.fc39.noarch 2/6 検証 : ansible-core-2.16.2-2.fc39.noarch 3/6 検証 : libdnf5-5.1.11-1.fc39.x86_64 4/6 検証 : python3-jinja2-3.1.3-1.fc39.noarch 5/6 検証 : python3-libdnf5-5.1.11-1.fc39.x86_64 6/6 インストール済み: ansible-9.1.0-1.fc39.noarch ansible-core-2.16.2-2.fc39.noarch libdnf5-5.1.11-1.fc39.x86_64 python3-jinja2-3.1.3-1.fc39.noarch python3-libdnf5-5.1.11-1.fc39.x86_64 python3-resolvelib-0.5.5-9.fc39.noarch 完了しました!
更新
$ pipx upgrade --include-injected ansible