November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Including variables in Ansible

Including variables in Ansible

===================================== [root@ansible1 ~]$ mkdir nginx ===================================== [root@ansible1 ~]$ cd nginx [root@ansible1 nginx]$ mkdir tasks vars

===================================== [root@ansible1 nginx]$ touch tasks/environment.yml ===================================== [root@ansible1 nginx]$ touch vars/variables.yml ===================================== [root@ansible1 ~]$ tree nginx nginx |– nginx.yml |– tasks | `– environment.yml `– vars `– variables.yml ===================================== [root@ansible1 nginx]$ vim tasks/environment.yml — – name: install […]

Continuous Delivery Using Docker And Ansible

Continuous Delivery Using Docker And Ansible

Continuous Delivery Release Often Release Faster Great Reliable

Continuous Delivery workflow/pipeline

With which we can Test,Build,Release,& Deploy a simple application.

Application will be of any technology ex:python based.

The work flow will be Based upon using docker & docker-compose which is a emerging technology. With a goal to release […]

how to use sysctl with ansible

[root@localhost ~]# sysctl -a |grep vm.swappiness vm.swappiness = 30

[root@localhost ~]# ansible-galaxy init sysctl – sysctl was created successfully

[root@localhost ~]# ansible-doc sysctl

[root@localhost ~]# vim test.yml — – hosts: localhost roles: – sysctl vars: sysctl_settings: – name: vm.swappiness value: 90

[root@localhost ~]# vim sysctl/tasks/main.yml — # tasks file for sysctl – name: sysctl settings […]

AWS with Ansible and Terraform

rmohan@root:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.4 LTS Release: 16.04 Codename: xenial rmohan@root:~$ python –version Python 2.7.12

rmohan@root:~$ sudo apt-get install python-pip Reading package lists… Done Building dependency tree Reading state information… Done python-pip is already the newest version (8.1.1-2ubuntu0.4). The following packages were automatically installed and are […]

Install latest ansible version

[root@ocp ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.4 (Maipo)

[root@ocp ~]# yum install python-pip

[root@ocp ~]# pip2.7 install ansible

[root@ocp ~]# ansible –version ansible 2.5.0 config file = None configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /bin/ansible python version = 2.7.5 (default, May […]

limits.conf with ansible

[root@localhost ~]# ansible-galaxy init limits.conf – limits.conf was created successfully

[root@localhost ~]# ansible-doc pam_limits

[root@localhost ~]# vim limits.conf/tasks/main.yml — # tasks file for limits.conf – pam_limits: domain: “{{ item.domain }}” limit_type: “{{ item.limit_type }}” limit_item: “{{ item.limit_item }}” value: “{{ item.value }}” with_items: “{{ limits_conf_settings }}”

[root@localhost ~]# vim limits_conf.yml — – hosts: all roles: […]

Ansible summary

# An Ansible summary # Configuration file [intro\_configuration.html](http://docs.ansible.com/intro_configuration.html) First one found from of * Contents of `$ANSIBLE_CONFIG` * `./ansible.cfg` * `~/.ansible.cfg` * `/etc/ansible/ansible.cfg` Configuration settings can be overridden by environment variables – see constants.py in the source tree for names. # Patterns [intro\_patterns.html](http://docs.ansible.com/intro_patterns.html) Used on the `ansible` command line, or in playbooks. * `all` (or […]

how to use sysctl with ansible

[root@localhost ~]# sysctl -a |grep vm.swappiness vm.swappiness = 30

[root@localhost ~]# ansible-galaxy init sysctl – sysctl was created successfully

[root@localhost ~]# ansible-doc sysctl

[root@localhost ~]# vim test.yml — – hosts: localhost roles: – sysctl vars: sysctl_settings: – name: vm.swappiness value: 90

[root@localhost ~]# vim sysctl/tasks/main.yml — # tasks file for sysctl – name: sysctl settings […]

ansible-playbooks one of the following is required name list

Ansible implementation of one of the following is required: name,list

Perform playbooks [root@controller playbook]# ansible-playbook package.yaml Error message

[root@controller playbook]# ansible-playbook package.yaml [WARNING]: While constructing a mapping from /root/ansible/playbook/package.yaml, line 11, column 5, found a duplicate dict key (name). Using last defined value only.

[WARNING]: Ignoring invalid attribute: state

PLAY [app] ****************************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] […]