Posts

Showing posts with the label ansible

Ansible script - take backup from httpd server folder / httpd.conf file into private github repo backup folder on every changes [on hold]

Ansible script - take backup from httpd server folder / httpd.conf file into private github repo backup folder on every changes [on hold] how to take backup from remote httpd server folder / httpd.conf file into my project remote github repo backup folder on every changes in httpd.conf file in Ansible script. Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question. Welcome to StackOverflow. Please take a look at How to Ask and Minimal, Complete, and Verifiable example. Please edit your question and add what you tried (the actual code). – Paxz Jun 29 at 9:17

ansible docker mount multiple port [duplicate]

ansible docker mount multiple port [duplicate] This question already has an answer here: ansible version ansible --version ansible 2.5.5 docker version docker --version Docker version 18.03.1-ce, build 9ee9f40 my Examples - name: start container docker_container: name: "tomcat-container" image: "tomcat-images" state: started ports: - "{{ item[0]}}:{{ item[1] }}" with_nested: - [8080,8080] - [8081,8081] FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'item' is undefinednnThe error appears to have been in '/home/playbook/roles/ts-docker/tasks/main.yml': line 81, column 3, but maynbe elsewhere in the file depending on the exact syntax problem.nnThe offending line appears to be:nnn- name: start containern ^ heren"} ...'item' is undefined How to solve the problem of mounting multiple port? -_-|| English is not good, forgive me This...

Pass multiple commands in ad-hoc mode in Cisco ios_command module

Pass multiple commands in ad-hoc mode in Cisco ios_command module I would like to know how can I pass multiple show commands in ios_command module in ad-hoc mode. show ios_command Sample with just one command: ansible all -m ios_command -a "commands='show version'" Now here I would like to send another command, say show run or any other. show run Any suggestions on this would be appreciated. 1 Answer 1 You need to pass a list and you can do it using JSON string: ansible all -m ios_command -a "commands='[ "show version", "show run" ]'" If you leave the spaces out, you can squeeze to 'commands=["show version","show run"]' 'commands=["show version","show run"]' Thanks I will try that and let you know – DilrajSK 2 days ago ...