More Related Content
Similar to Getting Started - Ansible Galaxy NG (20)
More from Hideki Saito (20)
Getting Started - Ansible Galaxy NG
- 2. 氏名: さいとう ひでき(Twitter: @saito_hideki)
所属: レッドハット株式会社 カスタマーエクスペリエンス&エンゲージメント
仕事: 世界の平和を守っているAnsibleサポートチームメンバーのサポート
趣味: AnsibleとOpenStack(最近ご無沙汰)
- 5. Red Hat Automation Hubにあわせて、Pulpベースで再構築された新たなGalaxyプラットフォーム
Automation HubのUpstream版という位置付けとなっています。
まだまだ枯れていませんが、Ansible Collectionsを提供するGalaxyサイトをプライベートに構築し
たいという奇特な方がいたら、是非テストしてみてください。
Galaxy NG URL: https://github.com/ansible/galaxy_ng.git
Pulp Project URL: https://pulpproject.org/
- 6. お手軽インストール事前準 (RHEL8)
$ sudo dnf install ansible
$ ansible-galaxy collection install pulp.pulp_installer
$ ansible-galaxy collection install ansible.galaxy_collection
$ git clone https://gist.github.com/629ba52d68301cc9798227b87704df84.git galaxy_ng
$ cd galaxy_ng
$ ansible-galaxy install
-r ~/.ansible/collections/ansible_collections/pulp/pulp_installer/requirements.yml
$ cat <<EOF >hosts
[galaxyng]
localhost ansible_connection=local
[galaxyng:vars]
ansible_become=True
EOF
- 7. お手軽インストール作業 (RHEL8)
$ ansible-playbook enduser-install.yml -i hosts --extra-vars "@upstream-rpm-install-vars.yml"
...中略...
PLAY [all]
*******************************************************************************************************
...中略...
PLAY RECAP
*******************************************************************************************************
localhost : ok=149 changed=83 unreachable=0 failed=0 skipped=41 rescued=0 ignored=0
「インストールするだけ」ならこれで完了!
- 8. お手軽なパッチ当て(/usr/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py)
--- collections.py.org 2020-12-11 15:56:49.000000000 +0000
+++ collections.py 2021-01-14 02:53:48.684494433 +0000
@@ -1,4 +1,4 @@
-import asyncio
+collection_version.save()import asyncio
from aiohttp.client_exceptions import ClientResponseError
from gettext import gettext as _
import json
@@ -244,6 +244,10 @@
last_highest.save()
collection_version.save()
+ elif collection_version.is_highest and collection_version.version != last_highest.version:
+ collection_version.is_highest = False
+ collection_version.save()
+
class AnsibleDeclarativeVersion(DeclarativeVersion):
"""
@@ -585,7 +589,8 @@
continue
collection_version = d_content.content
docs_blob = d_content.extra_data.get("docs_blob", {})
- collection_version.docs_blob = docs_blob
+ if docs_blob:
+ collection_version.docs_blob = docs_blob
for d_artifact in d_content.d_artifacts:
artifact = d_artifact.artifact
- 9. 設定変更とお手軽サービスリスタート
[設定修正]
# vi /etc/pulp/settings.py
...中略...
TOKEN_SERVER = "https://<IPADDRESS or HOSTNAME>/galaxy/token"
CONTENT_ORIGIN = "https://<IPADDRESS or HOSTNAME>"
...以下略...
[サービスリスタート]
# systemctl restart pulpcore-worker@1
# systemctl restart pulpcore-worker@2
# systemctl restart pulpcore-resource-manager
# systemctl restart pulpcore-content
# systemctl restart pulpcore-api