Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahuffman/ansible-resolv
Ansible role to configure /etc/resolv.conf
https://github.com/ahuffman/ansible-resolv
ansible ansible-role resolv resolv-conf
Last synced: 3 months ago
JSON representation
Ansible role to configure /etc/resolv.conf
- Host: GitHub
- URL: https://github.com/ahuffman/ansible-resolv
- Owner: ahuffman
- License: mit
- Created: 2016-05-03T21:47:15.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T21:05:22.000Z (about 3 years ago)
- Last Synced: 2024-10-14T07:31:49.696Z (4 months ago)
- Topics: ansible, ansible-role, resolv, resolv-conf
- Language: Jinja
- Size: 12.7 KB
- Stars: 46
- Watchers: 5
- Forks: 30
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Ansible Role](https://img.shields.io/ansible/role/d/9527)
# ahuffman.resolv
An Ansible role to configure /etc/resolv.conf## Role Variables
### Defaults
| Variable Name | Required | Description | Default Value | Type |
| --- | :---: | --- | :---: | :---: |
|resolv_nameservers| yes | A list of up to 3 nameserver IP addresses | [] | list |
| resolv_domain | no | Local domain name | "" | string |
| resolv_search | no | List of up to 6 domains to search for host-name lookup | [] | list |
| resolv_sortlist | no | List of IP-address and netmask pairs to sort addresses returned by gethostbyname. | [] | list |
| resolv_options | no | List of options to modify certain internal resolver variables. | [] | list |## Example Playbooks
### Role Invocation
```yaml
- name: "Role Invocation - ahuffman.resolv Example"
hosts: "all"
roles:
- role: "ahuffman.resolv"
resolv_nameservers:
- "8.8.8.8"
- "8.8.4.4"
resolv_domain: "foo.org"
resolv_search:
- "foo.bar"
- "foobar.com"
resolv_options:
- "timeout:2"
- "rotate"
```
### Role Invocation with externaly defined variables (group_vars / host_vars)
```yaml
- name: "Role Invocation - ahuffman.resolv Example"
hosts: "all"
roles:
- role: "ahuffman.resolv"
when:
- resolv_nameservers is defined
- resolv_nameservers | length > 0
```
### Included Role
```yaml
---
- name: "Included Role - ahuffman.resolv Example"
hosts: "all"
tasks:
- name: "Configure resolv.conf"
include_role:
name: "ahuffman.resolv"
vars:
resolv_nameservers:
- "8.8.8.8"
- "8.8.4.4"
resolv_domain: "foo.org"
resolv_search:
- "foo.bar"
- "foobar.com"
resolv_options:
- "timeout:2"
- "rotate"
```
## License
[MIT](LICENSE)## Author Information
[Andrew J. Huffman](https://github.com/ahuffman)