Questions tagged [ansible-2.x]

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems

Ansible 2.x is a new backwards-incompatible version that involved a rewrite of the core, and a new API.

Ansible 2.x features new commands like ansible-vault, allowing you to store encrypted information in playbooks and have them decrypted on the fly. It also includes new concepts like Task Blocks, Dynamic Includes, Execution Strategy Plugins, and a suite of new "batteries included" modules. Most importantly, new releases are named after Led Zepplin songs, rather than Van Halen.

https://raw.githubusercontent.com/ansible/ansible/stable-2.0/CHANGELOG.md

Related Tags

1908 questions
0
votes
1 answer

Ansible run delegate_to task on remote machine as different user

I want to set a cron entry on a remote host, but connecting to the host as a different user. # task - name: Cron to ls at a specific time cron: name: "perform a listing" weekday: "6" minute: "5" hour: "3" job: "/bin/ls -lR…
mindrunner
  • 166
  • 3
  • 11
0
votes
1 answer

Running task as unprivileged user in ansible

I have 2 users: dashadmin and dash I have my target machine with settings that only allow access as privileged user dashadmin, root ssh has been locked. For security reasons i would like to keep user dash unpriviiged. I am trying to administer a…
unchained
  • 23
  • 6
0
votes
2 answers

Change remote_user within main.yml in role

I am new to ansible. i am trying to create a role where i start the playbook as root and then in the next play i switch to a different user and continue. The following files are within the role itself. --- # tasks file for…
unchained
  • 23
  • 6
0
votes
0 answers

Ansible set fact: evaluate a json path with a variable

I need to fetch data with conditions. This piece of code worked for me. - name: retriving passwords... uri: ........... register: this - name: Setting ssh secret fact... set_fact: ssh_secret: "{{…
bosari
  • 1,922
  • 1
  • 19
  • 38
0
votes
1 answer

Issue running fortinet.fortios in Ansible playbook (bad host file? plugins not installed?)

I am getting an error with this playbook and am not sure where to look. Perhaps something isn't defined right in my host file? (I'm told the playbook is good) YML Playbook - hosts: fortigates collections: - fortinet.fortios connection:…
Roger
  • 365
  • 2
  • 18
0
votes
0 answers

problems running Ansible 2.9.10 fortinet.fortios playbook

Any suggestions on how to get the following playbook to run? Below are my playbook, hostfile, and error. Playbook --- - hosts: fortigates collections: - fortinet.fortios connection: httpapi vars: vdom: "root" ansible_httpapi_use_ssl:…
Roger
  • 365
  • 2
  • 18
0
votes
0 answers

store multiple ec2 intance details in host file Ansible?

i had launched 2 instances using the following code - name: Launch the new EC2 Instance ec2: key_name : "{{keypair}}" group: "{{ security_group }}" instance_type: "{{ instance_type }}" image: "{{…
avsr
  • 143
  • 3
  • 15
0
votes
1 answer

How to specify log per task on ansible playbook

I have 1 roles with 14 tasks, when running roles, they will run 14 tasks in turn, and the results return all 14 tasks, is there any other way for me to have each task have a separate log file in ansible? ? If possible please show me the example,…
0
votes
1 answer

Adding space in front of each line in ansible block

I am trying to add a block in a file with space in front of it. Ansible script i used is given below. - name: Disable Apache Directory listing, Symbolic Links, Server side includes and CGI execution blockinfile: dest:…
Sreeraju V
  • 535
  • 2
  • 5
  • 19
0
votes
0 answers

Ansible delegation on Windows client using delegate_to : not working as expected

I'm using ansible 2.9 to run some tasks on localhost, and then tasks on a Windows host (using powershell as default shell), and then final tasks on localhost again. Right now I'm running then separately in the play as such : - hosts: localhost …
JaneD
  • 149
  • 1
  • 2
  • 15
0
votes
1 answer

ansible to display the value as well eventhough the string does not match

I am trying to find whether the host VM's are set with ssh connection is 36000. Below is my code.. tasks: - name: To check SSH connection is set to 36000 lineinfile: dest: /etc/ssh/sshd_config line: "ClientAliveInterval…
user1509613
  • 151
  • 2
  • 3
  • 9
0
votes
1 answer

Ansible documentation

I would like to check if there is anyways to get the following documentation from RHEL8 system without internet access…
abduls85
  • 548
  • 8
  • 15
0
votes
1 answer

Ansible - Importing group_vars all.yml from a playbook

I got a dir structure like this: . ├── inventories │   └── production │   ├── ansible.cfg │   ├── group_vars │   │   ├── all.yml │ │ └── gitlab.yml │   ├── hosts │   └── host_vars │   ├── playbooks │   └──…
Zekeriya Akgül
  • 308
  • 4
  • 14
0
votes
2 answers

when a string exists in registered variable ansible task

Team, I have two tasks and one is save outout to register variable and next is checking if a strings exists in it. but it calling synatx error. Any hint observed? Do i need to set fact for this ? if yes how? - name: "Capture DiskCache enablement…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
0 answers

how to run tagged task while running ansible roles via commandline

Am trying to execute the ansible role via commandline option but not able to call/execute only required tagged tasks within called role task. if i don't include the tags in the commandline then it works as expected but i don't want execute full role…
vrledu
  • 35
  • 2
  • 8