serverscom / serverscom.sc_api / 0.1.0 / module / sc_cloud_computing_instance_ptr Manage cloud instances PTR records | "added in version" 1.0.0 of serverscom.sc_api" Authors: George Shuklin (@amarao) preview | supported by communityserverscom.sc_api.sc_cloud_computing_instance_ptr (0.1.0) — module
Install with ansible-galaxy collection install serverscom.sc_api:==0.1.0
collections: - name: serverscom.sc_api version: 0.1.0
Add or remove PTR records to IP addresses of the instance.
- name: Add ptr record to all IP to instance by name sc_cloud_computing_instance_ptr: token: '{{ sc_token }}' name: myinstance domain: ptr.example.com state: present
- name: Add ptr record to IP 203.0.113.1 to instance by ID sc_cloud_computing_instance_ptr: token: '{{ sc_token }}' instance_id: M7e5Ba2v domain: ptr.example.org ip: 203.0.113.1 ttl: 42 priority: 42 state: present
- name: Remove all PTRs for instance by name sc_cloud_computing_instance_ptr: token: '{{ sc_token }}' name: myinstance region_id: 2 state: absent
- name: Remove PTRs for specific IP for instance sc_cloud_computing_instance_ptr: token: '{{ sc_token }}' instance_id: M7e5Ba2v ip: 198.51.100.42 state: absent
- name: Remove PTRs for specific domain for instance sc_cloud_computing_instance_ptr: token: '{{ sc_token }}' instance_id: M7e5Ba2v domain: badptr.example.com state: absent
ip: default: all description: - IP address for PTR record. - IP address must belong to instance. - Reserved keyword C(all) can be used for automatically use all instance IP addresses. - Required for I(state)=C(present) type: str ttl: description: - TTL (time to live) value for PTR caching. - Default API value C(60) is used if not specified. type: int name: aliases: - instance_name description: - Name of the instance to set PTR records for. - If more than one server with a given name found, module will fail. - Use I(instance_id) for precise identification. - Mutually exclusive with I(instance_id). type: str state: choices: - present - absent - query description: - State of the ptr record. - C(query) does not change anything and returns current list of PTRs for instance. required: true type: str token: description: - Token to use. - You can create token for you account in https://portal.servers.com in Profile -> Public API section. required: true type: str domain: description: - PTR domain name to accociate with IP address(es). - Required for I(state)=C(present). - I(ip) or I(domain) required for I(state)=C(absent). type: str endpoint: default: https://api.servers.com/v1 description: - Endpoint to use to connect to API. - Do not change until specifically asked to do otherwise. type: str priority: description: - Priority of the PTR record. - Default API value C(0) is used if not specified. type: int region_id: description: - Region ID to search instance by name. - All regions are searched if not specified. - Used only if I(name) present. type: int instance_id: description: - Id of the instance to manage PTR records for. - Mutually exclusive with I(name). type: str