外围体育投注

Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts

Ansible - Simple IT Automation

r/ansible

4
Posted by2 hours ago

外围体育投注I'm looking into creating a playbook so a non-team member can run various "show" commands on a network switch/router. I was looking at the survey multiple choice options. This seems like it might work for me but i'm getting stuck on how to variablize these entries and properly/dynamically integrate them into my playbook. Has anyone worked on a similar problem and come up with an elegant solution?

外围体育投注For example, the survey could say -- select site, select command to run. Then my playbook would take these two variables and run a task based on this. I don't want to do something like a bunch of IF/WHEN statements. Could I use these vars as tags or skip-tags maybe?

4
1 comment
2.3k
promotedPosted by1 month ago
Comments are locked
View Comments
Play
0:00
0:00
Settings
Fullscreen
2.3k
0 comments
18
Posted by11 hours ago

I all, I am looking to use ansible in my network but the price for Tower makes it hard to be worth while. Are their any good use cases that could justify its price?

18
39 comments
2
Posted by7 hours ago

...have ansible playbook read in a csv and substitute specific variables per host as it loops through the hosts in the hosts file i supply with -i

...or am wanting it to do something that it's not designed to do?

forgive my newbness.

2
4 comments
1
Posted by6 hours ago

外围体育投注I'm pretty new to Ansible and just getting started on writing some playbooks. One of the tasks I have is to perform some audits on our systems.

So one of the first ones I'm working on is just a simple list of the yum repositories. I can get the yum module to show them on an ad-hoc command just fine, so I'm good with the syntax of the yum module to list the repos.

However; I want to register the result - but with this playbook, it tells me that the variable is undefined.

  - hosts: all
    become: yes

    tasks:
    - name: Section 1.1 - Check Yum Repos
      yum:
        list=repos
      register: section1

    - debug: var=section1.stdout

外围体育投注Works, but with 'Variable Undefined' ^^

外围体育投注What am I doing wrong there? I can't indent the 'register' right under 'list=repos' or it will throw an error.

1
2 comments
2
Posted by11 hours ago

Hi,

外围体育投注I'm trying to push haproxy config to our haproxy server. We currently have 3 haproxy and 3 nginx servers. Now we would like to append config to the haproxy.cfg file on the haproxy servers.

Same code:

### Backends ###

   backend test1
       balance roundrobin
       server test1_api nginx1_ip:8001
       server test1_api2 nginx2_ip:8001
       server test1_api3 nginx3_ip:8001
 
   backend test2
       balance roundrobin
       server test2_api nginx1_ip:8002
       server test2_api2 nginx2_ip:8002
       server test2_api3 nginx3_ip:8002
2
2 comments
11
Posted by22 hours ago

Hi all,

外围体育投注I'm trying to determine if this is possible.


I want to invoke a job template against Host A to collect facts (hostname & IP Address) of Host A and store them in a variable. I then want to execute a script on Host B passing in the variables from Host A.


Effectively, I am pulling the hostname & ip address from host A and then executing a script on host B to create a DNS record using the hostname & ip from Host A

Host A does not have the capability to interface with our DNS server API so I cannot create the record directly from host A hence needing to invoke host B to create the record

Thanks in advance

11
3 comments
2
Posted by13 hours ago

^ as stated in title.

2
2 comments

About Community

Automation for the People! A Subreddit dedicated to fostering communication in the Ansible Community, includes Ansible, AWX, Ansible Tower, Ansible Galaxy, ansible-lint, Molecule, etc.
31.6k

Members

112

Online


Created May 10, 2013

Related Reddits

r/awx

595 members

Useful docs

Moderators