Need to add host entires in awx pod

490 views
Skip to first unread message

Ahilan Swaminathan

unread,
Jul 17, 2022, 5:58:51 AM7/17/22
to awx-p...@googlegroups.com, Rebeccah Hunter, Ahilan Swaminathan
Hi Rebeccah/Team

I want to add more entries in (/etc/hosts) in awx pod but not sure where I put "hostAliases". Please help me to add entries in hosts file in awx pod. 

Thanks and Regards
S.Ahilan
Lead Analyst
CGI Software Solutions and consultant Pvt Ltd
DLF IT Park
Chennai 600089
+91-9486332230



Yan-ren Tsai

unread,
Jul 17, 2022, 9:10:24 AM7/17/22
to AWX Project
Hi,

You can use hostAliases .



ahil...@gmail.com 在 2022年7月17日 星期日下午5:58:51 [UTC+8] 的信中寫道:

Wei-Yen Tan

unread,
Jul 17, 2022, 10:43:40 AM7/17/22
to awx-p...@googlegroups.com
You can put it in the container instances (iirc) in awx. There is a setting to modify the pod spec 

From: awx-p...@googlegroups.com <awx-p...@googlegroups.com> on behalf of Yan-ren Tsai <ell...@gmail.com>
Sent: Monday, July 18, 2022 1:10:24 AM
To: AWX Project <awx-p...@googlegroups.com>
Subject: [awx-project] Re: Need to add host entires in awx pod
 
--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/b3307791-30e4-43dc-ac3d-392e39578818n%40googlegroups.com.

Ahilan Swaminathan

unread,
Jul 18, 2022, 12:01:04 AM7/18/22
to awx-p...@googlegroups.com
Hi Yen

You want me to edit running awx pod instance and add entities in "spec" section??? Can you please elaborate?

Wei-Yen Tan

unread,
Jul 18, 2022, 12:02:29 AM7/18/22
to awx-p...@googlegroups.com
No. You don't. All automation  jobs run in an ee in awx 18+. So that's where you change it 

From: awx-p...@googlegroups.com <awx-p...@googlegroups.com> on behalf of Ahilan Swaminathan <ahil...@gmail.com>
Sent: Monday, July 18, 2022 4:00:49 PM
To: awx-p...@googlegroups.com <awx-p...@googlegroups.com>
Subject: Re: [awx-project] Re: Need to add host entires in awx pod
 

Wei-Yen Tan

unread,
Jul 18, 2022, 12:05:36 AM7/18/22
to awx-p...@googlegroups.com

Ahilan Swaminathan

unread,
Jul 18, 2022, 12:14:59 AM7/18/22
to awx-p...@googlegroups.com
Hi Yen

Here my awx details!!!

[kubeadmin@xl8phxc360awxtst ~]$ k get pods
NAME                                              READY   STATUS    RESTARTS       AGE
awx-567bcb5746-zkp74                              4/4     Running   44 (18h ago)   2d11h
awx-operator-controller-manager-6c69f7cdb-fd7fp   2/2     Running   30 (18h ago)   22d
awx-postgres-0                                    1/1     Running   15 (18h ago)   22d
[kubeadmin@xl8phxc360awxtst ~]$ kubectl get pods awx-567bcb5746-zkp74 -o jsonpath='{.spec.containers[*].name}'
redis awx-web awx-task awx-ee[kubeadmin@xl8phxc360awxtst ~]$
[kubeadmin@xl8phxc360awxtst ~]$ kubectl get pods awx-postgres-0 -o jsonpath='{.spec.containers[*].name}'
postgres[kubeadmin@xl8phxc360awxtst ~]$
[kubeadmin@xl8phxc360awxtst ~]$ kubectl get pods awx-operator-controller-manager-6c69f7cdb-fd7fp -o jsonpath='{.spec.containers[*].name}'
kube-rbac-proxy awx-manager[kubeadmin@xl8phxc360awxtst ~]$
[kubeadmin@xl8phxc360awxtst ~]$
[kubeadmin@xl8phxc360awxtst ~]$

Now Please guide me how can I add my hostAliases in my running AWX.

Below the entry I need to add in my awx pod /etc/hosts!!!
hostAliases:
  - ip: "x.x.x.x"
    hostnames: "basemachine"
  - ip: "x.x.x.x"
    hostnames: "ansiblemaster"

Ankit Pandey

unread,
Aug 23, 2022, 4:21:25 AM8/23/22
to AWX Project
Hi Ahil,

Did you manage to do this?
Even i also wanted to same, as i have some github hostname i want to access, but hostname to ip mapping is required in /etc/hosts to sync project.
Do anyone has idea how i can achive this?
It seems i can do using host alias, but that don't apply to running ee container
Please help me as i am stuck here, not able to procced further

Thanks & Regards,
Ankit Pandey

Wei-Yen Tan

unread,
Aug 23, 2022, 5:46:16 AM8/23/22
to awx-p...@googlegroups.com
Sorry I missed your message. All  container spec details are under administration --> instance groups ---> create container group. As your container spec details there 

From: 'Ankit Pandey' via AWX Project <awx-p...@googlegroups.com>
Sent: Tuesday, August 23, 2022 8:21:25 PM
To: AWX Project <awx-p...@googlegroups.com>

Ankit Pandey

unread,
Aug 24, 2022, 3:11:39 AM8/24/22
to AWX Project
Hi Weiye,

My doubt is i want to have a execution env containers '/etc/hosts' file patched with a hostname and ip address mapping entries, as my github is outside the network and node DNS not able to resolve the name. Is there is anyway i can customize the ee container spec?
I am ready to create new execution env or i can patch the existing ee container.

Thanks & Regards,
Ankit Pandey

Wei-Yen Tan

unread,
Aug 24, 2022, 3:25:57 AM8/24/22
to awx-p...@googlegroups.com
Look above. That's where you set it 

From: 'Ankit Pandey' via AWX Project <awx-p...@googlegroups.com>
Sent: Wednesday, August 24, 2022 7:11:39 PM

Ankit Pandey

unread,
Aug 24, 2022, 3:56:12 AM8/24/22
to AWX Project
No, not able to do there, it creates new, projects are synced via EE, so that place doesn't help me as it creates new container everytime. Please show one example how we can do..

Wei-Yen Tan

unread,
Aug 24, 2022, 5:19:10 AM8/24/22
to awx-p...@googlegroups.com
Kindly look at this link. It tells you how to modify the spec based on customising the volume mounts. Customise the pod spec for your needs 

From: 'Ankit Pandey' via AWX Project <awx-p...@googlegroups.com>
Sent: Wednesday, August 24, 2022 7:56:12 PM

Wei-Yen Tan

unread,
Aug 24, 2022, 5:19:31 AM8/24/22
to awx-p...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages