ã¬ãããããã®ææã§ããAnsible ã®ãã¯ãã«ã«ãµãã¼ãããã¦ãã¾ããæ¯æ1ã¤ã¯ä½ãæ¸ããã¨ãç®æ¨ã«ãã¦ãã¾ãã
ä»æ㯠execution environments ã«ã¤ãã¦ç´¹ä»ãã¾ãã
Ansible 㯠Python ã§æ¸ããã¦ãããPython ã®å®è¡ç°å¢ãä½ã£ã¦ã©ã¤ãã©ãªãã¢ã¸ã¥ã¼ã«ã®ä¾åé¢ä¿ãéãè¾¼ãã¦å®è¡ããããã«ãªã£ã¦ãã¾ãã
æ§ Ansible Tower ã§ã¯ virtual environment ã®ä»çµã¿ã使ã£ã¦ãã¾ããã以åè¨äºãæ¸ãã¾ããã®ã§ã覧ãã ããã
Ansible automation controller (æ§ç§° Ansible Tower) ã§ã¯ãvirtual environment 㯠controller ã® Web UI ããµã¼ãã¹ãªã©ãåä½ããããã ãã«ä½¿ãããããã«ãªããansible-playbook ãªã©ã®ã³ãã³ã㯠execution environments ã¨ããå¥ãªä»çµã¿ã使ãããã«ãªãã¾ããã
execution environments ã¯ãã®ãããªç¹å¾´ãåãã¦ãã¾ãã
- Red Hat Enterprise Linux UBI 8 ããã¼ã¹ã¨ããã³ã³ããã¤ã¡ã¼ã¸
- Ansible 2.9 ããã㯠Ansible Core 2.11 ãåä½ããããã¨ãã§ãã
- Python 3.8
- Collections ããããããã¤ã³ã¹ãã¼ã«ãã
- Python ã®ä¾åã©ã¤ãã©ãªãåä½ã«å¿ è¦ãªè¨å®ãã¡ã¤ã«ãªã©ããããããã¤ã³ã¹ãã¼ã«ã§ãã
å®è¡ç°å¢ãã³ã³ããã¨ãã¦ã¾ã¨ãããããã¨ã«ãããPodman ã®ã³ã³ããã¨ãã¦æ±ããããã«ãªãã¾ããã¤ã¡ã¼ã¸é å¸ã®ä»çµã¿ãæ°ãã Automation Hub ã«åãå ¥ããããã¯ã©ã¹ã¿ã¨ãã¦è¤æ°å°ã® controller ã使ãå ´åã§ããããããã« virtual environment ãä½ããªãã¦ããããªã£ã¦ãã¾ãã
execution environments ã®ä½ãæ¹
Ansible Automation Platform 2.0.x ãã¤ã³ã¹ãã¼ã«ãã¾ãã¨ãããã¤ãã® execution environments ãåæã¤ã³ã¹ãã¼ã«ããã¾ãã
- ansible-automation-platform-20-early-access/ee-supported-rhel8
- ansible-automation-platform-20-early-access/ee-minimal-rhel8
ãã¡ãã® Container images ã®ãµã¤ãããæ¤ç´¢ãã¦è¦ã¤ãããã¨ãã§ãã¾ãããåç¬ã§åã£ã¦æ¥ã¦å©ç¨ããã ããã¨ã¯ãå§ããã¾ããã
以å virtual environment ã§å©ç¨ããã¦ããããã«èªåã§ã«ã¹ã¿ãã¤ãºãã¦ä½¿ãããã¨ãã«ã¯ãansible-builder ãç¨æããã¦ãã¾ããè±èªã§ã¯ããã¾ãããã¡ãã«ããã¥ã¡ã³ããæ¸ãã¾ããã®ã§ãå¼ç¤¾ã®ã¢ã«ã¦ã³ããããæ¹ã¯ã覧ãã ããã
ä¾ãã°ã³ãã¥ããã£ã§éçºããã¦ããã³ã¬ã¯ã·ã§ã³ã使ãããã¨ãã«ã¯å¿ è¦ã«ãªãã¨æãã¾ããããã¸ã§ã¯ãã®ä¸ã§ collections/requirements.yml ãç½®ããã¨ã§ãããã¸ã§ã¯ããåæããã¨ãã«ã³ã¬ã¯ã·ã§ã³ãåçã«ãã¦ã³ãã¼ããã¦ããã¨ããæ©è½ããããã¨ã¯å æ解説ãã¾ãããããã®ã³ã¬ã¯ã·ã§ã³ã Python ã®ã¢ã¸ã¥ã¼ã«ã«ä¾åãã¦ãã¦è¿½å ã§å®è¡ç°å¢ã«ã¤ã³ã¹ãã¼ã«ãã¦ãããªããã°ãããªãã¨ãã«ã¯ããã® requirements.yml ã§ã¯å¯¾å¿ã§ããªãã¨ããåé¡ãããã¾ããã
ä»ã«ãä¸ã®ããã¥ã¡ã³ãã®ä¾ã«ãæ¸ãã¾ããããWindows ãæä½ããããã« Kerberos èªè¨¼ãå¿ è¦ã¨ãªã£ã¦ /etc/krb5.conf ã®è¨å®ãæå·åå¨ãã®è¨å®ãã«ã¹ã¿ãã¤ãºããªããã°ãããªãå ´åã«ã¯ããã¯ã execution environments ãä½ã£ã¦ããã ããã¨ã«ãªãã¾ãã
execution environments ã®ä½¿ãæ¹
controller ã® Web UI ããã¯ããå®è¡ç°å¢ãã«ç»é²ããã°ããã¸ã§ã¯ããã¸ã§ããã³ãã¬ã¼ããã¤ã³ãã³ããªã¼åæãªã©ã§ä½¿ãã¾ãã
ã³ãã³ãã©ã¤ã³ããã¯ãansible-navigator ãéãã¦ä½¿ããã¨ãã§ãã¾ããansible-builder ã¨åæ§ã«ãansible-automation-platform-2.0-early-access-for-rhel-8-x86_64-rpms ã®ãªãã¸ããªãã dnf ã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã
# dnf install ansible-navigator
controller ä¸ã§èµ·åãããå ´åã«ã¯ãawx ã¦ã¼ã¶ã§ã使ãããã ãã¨ä¾¿å©ã§ãããã¨ãã°ãããã®ç°å¢ã§ã¯ãã®ããã«ã¤ã¡ã¼ã¸ãããã¾ãã
# su - awx $ podman images REPOSITORY TAG IMAGE ID CREATED SIZE localhost/ee-supported-rc4-with-collections latest 6b024619c7ea 13 days ago 1.24 GB localhost/latest_aws_collection_execution_environment_minimal latest 808626f78226 2 weeks ago 400 MB registry.redhat.io/ansible-automation-platform-20-early-access/ee-supported-rhel8 2.0.0 85ca2003a842 2 months ago 920 MB registry.redhat.io/ansible-automation-platform-20-early-access/ee-minimal-rhel8 2.0.0 078c7d4aca51 2 months ago 288 MB registry.redhat.io/ansible-automation-platform-20-early-access/ansible-builder-rhel8 2.0.0 df5d9fdcdbd4 2 months ago 359 MB
ansible-navigator ãããè¦ããã¨ãã§ãã¾ããansible-navigator images ã³ãã³ããå®è¡ããã¨ãæãæãåºããããªãã£ã©ã¯ã¿ãã¼ã¹ã®ã¢ããªã±ã¼ã·ã§ã³ãèµ·åãã¾ããæ°åãæ¼ãã¦ãããããã©ã£ã¦ã¿ã¦ãã ããã
ãã¡ãã Ansible ã®ã³ãã³ããå®è¡ãããã¨ãã§ãã¾ããinventory 㨠playbook.yml ãç¨æãã¦ãee ãæå®ãã¦èµ·åããä¾ã§ãã
$ ansible-navigator run playbook.yml -i inventory --eei registry.redhat.io/ansible-automation-platform-20-early-access/ee-supported-rhel8:2.0.0
å ¨ä½ã®å®è¡çµæã表示ããã¦ãæ°åãæ¼ããã¨ã§ä¸ãæã£ã¦è¦ã¦ãããã¨ãã§ãã¾ãã
å¾æ¥ã®ãããªåºåã§å®è¡ããããã¨ãã§ãã¾ãã
$ ansible-navigator run playbook.yml -i inventory --eei registry.redhat.io/ansible-automation-platform-20-early-access/ee-supported-rhel8:2.0.0 -m stdout PLAY [servers] ***************************************************************** TASK [Gathering Facts] ********************************************************* ok: [192.168.0.100] ok: [192.168.0.101] ok: [192.168.0.102] TASK [ping] ******************************************************************** ok: [192.168.0.102] ok: [192.168.0.101] ok: [192.168.0.100] PLAY RECAP ********************************************************************* 192.168.0.100 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 192.168.0.101 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 192.168.0.102 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 $
ãã¬ã¤ããã¯ãå®è¡ããã ãã ã¨ãã¾ã便å©ã«ãªã£ããããªæ°ã¯ãã¾ããããä»ã«ãããããã¨æ©è½ã¯ããã¾ãã®ã§ããèå³ããã¾ããããæå ã§ãåããã¦ã¿ã¦ãã ãããããã¥ã¡ã³ãã¯ãã¡ãã§ãã
ãã¾ã
å®éã«ã¯ podman ã³ãã³ãããå®è¡ãã¦ãã¾ããã¨ãããããã¾ãã
$ podman run -it registry.redhat.io/ansible-automation-platform-20-early-access/ee-supported-rhel8:2.0.0 ansible --version ansible [core 2.11.2] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.8/site-packages/ansible ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 2.10.3 libyaml = True $ podman run -it registry.redhat.io/ansible-automation-platform-20-early-access/ee-supported-rhel8:2.0.0 ansible-galaxy collection list # /usr/share/ansible/collections/ansible_collections Collection Version ------------------------ ------- amazon.aws 1.5.0 ansible.controller 4.0.0 ansible.netcommon 2.2.0 ansible.network 1.0.1 ...
å¤ãããã¡ã¤ã«ãä¸ããªãã¨ãããªãå ´åã«ã¯ã³ã³ããã®æ§è³ªä¸ãã®ã¾ã¾ã§ã¯åä½ãã¾ããã®ã§ãansible-navigator ã³ãã³ãã使ããã¨ãããã¾ããcontroller ã® Web UI ããããã¸ã§ã¯ããã¸ã§ããã³ãã¬ã¼ããä½ã£ã¦å®è¡ããã®ãä¸çªæ¥½ã ã¨ã¯æãã¾ãã
ãããã«
Ansible Automation Platform 2.0 ã§å°å ¥ãããå®è¡ç°å¢ (execution environments) ã«ã¤ãã¦ç´¹ä»ãã¦ã¿ã¾ããã
ã³ã³ããã®æ±ãã¯ãããã¾ã¨ãªã£ã¦ã¯å¸¸èã«ãªã£ã¦ãã¦ããã¨ãããããã¨æãã¾ãããåºãæ®åããã³ã³ããã®ç¥èã Ansible Automation Platform ã§ããå©ç¨ããã ããã®ã¯ã¨ã¦ã大ããã¨æãã¾ãã
Ansible Automation Platform 㯠Developer Subscription ã§ãã試ãããã ãã¾ãã®ã§ããèå³æããã¾ããã試ãã¦ã¿ã¦ãã ããã
Happy Automation!