April 2018
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Categories

April 2018
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  

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 […]