Questions tagged [ansible-playbook]

468 questions
0
votes
1 answer

Ansible - User creation when server class criteria is met

I'm a new ansible user, switching from a collection of shell scripts to ansible playbooks. My current user management system allows for adding a user to a system only if that user has been granted access to that Server class, Location, and…
Danny F
  • 498
  • 3
  • 10
0
votes
1 answer

validate all the files before copying to all the remote servers

I have an ansible playbook which is made up of two plays as shown below: First play validates everything on the localbox where I am running my ansible before invoking Play2. If my validation fails in Play1 then I don't want to start Play2 at…
user1950349
  • 223
  • 1
  • 3
  • 10
0
votes
1 answer

Login into an EC2 instance as root user

I am trying to run the following ansible playbook against an AWS EC2 instance. I need to run that script as root user in order to access the docker engine. I dynamically populate the builders hosts group before running the playbook. - name: Create…
soosap
  • 103
  • 4
0
votes
3 answers

Ansible pyenv virtualenv gives error for pip

I have ansible task - name: Install setuptools in virtual environment pip: name: setuptools-git virtualenv: "myenv" virtualenv_command: "/root/.pyenv/bin/pyenv virtualenv 2.7.13" But it gives error fatal: [localhost]: FAILED!…
Nilesh
  • 255
  • 1
  • 6
  • 18
0
votes
2 answers

Error while using commands for compile and install nagios using Ansible

- name: installing dependencies yum: name: "{{ item }}" state: present with_items: - gcc - glibc - glibc-common - gd - gd-devel - make - net-snmp - libselinux-python - name: adding group group: name: nagcmd …
arun mohan
  • 183
  • 2
  • 2
  • 9
0
votes
1 answer

Ansible enable audit logging

I am looking for audit logging in Ansible. I am running my playbook as root, but i want to write in log who the local user is executing the playbook. Please help in enabling logs to show user.
vvkr
  • 21
  • 5
0
votes
1 answer

Zookeeper status checking with Ansible failing

I am trying to find the status of Zookeeper process by shooting /path/to/zookeeper/bin/zkServer.sh status and checking the rc variable. But the ansible says that output doesn't have the rc variable in output. I am attaching few snippets: Here, the…
0
votes
1 answer

Ansible group_vars visible to non-members of group

I am using Ansible 2.0.0.2. I have inventory file like this: [webproxy] testserver [database] testserver [application] testserver [testing:children] webproxy database I run roles from playbooks like this: --- - hosts: application become:…
Madoc Comadrin
  • 570
  • 4
  • 11
  • 29
0
votes
1 answer

public ssh id is different on id_rsa.pub than in ansible_ssh_host_key_rsa_public

I would like to do a passwordless SSH login to another Linux server, and I would like to do the setup using ansible Could you please advise why ~/.ssh/id_rsa.pub hostvars[item]['ansible_ssh_host_key_rsa_public'] are different ? Here is the task…
nskalis
  • 147
  • 1
  • 4
  • 10
0
votes
1 answer

Ansible - Intercept POST Request

I'm looking to trigger an Ansible Playbook via a POST request. For example, I want to make Ansible listen on some port so that it can intercept a POST request, parse the JSON, and inject the values into the variables with the same key name. So far,…
Darrel Holt
  • 103
  • 6
0
votes
1 answer

Ansible playbook Issue

I have a playbook which will checkout the code from git copy the changes to the respective remote server and execute the process and share the output back to github now that everything is fine lastly I need to restart the server,but my issue is it…
Rakshu
  • 1
  • 4
0
votes
1 answer

ANSIBLE set tags per item in with_items loop

I have this playbook to create ec2 instances and will like to target each ec2 creation by tags but not working...when i run playbook i do not get any errors but notting gets created. --- - name: Build or Check environment hosts: localhost …
0
votes
2 answers

how to assign the UID from the given range in ansible task

I have an ansible task to create a user and instead of specifying UID class as shown below, it has to pick from the a free range between (1000-1099) and has to assign the next available UID in a sequential order, how to do this ? - name: create…
0
votes
1 answer

Ansible returns no action detected in task when running the example of the lxd_container module

I used the following page https://docs.ansible.com/ansible/lxd_container_module.html to extract the below lxd example and put it into a YAML file: >>> cat play.yaml --- # An example for creating a Ubuntu container and install python - hosts:…
Greg
  • 1,657
  • 5
  • 27
  • 38
0
votes
0 answers

Ansible Jenkins plugin not working in GKE on top of docker/kubernetes - infinite loop

I have such simple playbook: - hosts: 123.123.123.123 tasks: - name: Jenkins - add job jenkins_job: config: "{{ lookup('file', 'jenkins_conf/pipeline_staging.xml') }}" name:…