|
| 1 | +# NetScaler ADC Collection |
| 2 | + |
| 3 | +## Description |
| 4 | +The collection provides Ansible modules to configure and manage NetScaler ADC appliances. The modules are written using the [NITRO API](https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release.html). The modules are idempotent and can be used to configure the NetScaler ADC appliances in a declarative manner. |
| 5 | + |
| 6 | +## Requirements |
| 7 | + |
| 8 | +### Ansible version compatibility |
| 9 | +Tested with Ansible Core >=2.15 versions. |
| 10 | + |
| 11 | +### Python version compatibility |
| 12 | +Tested with Python >=3.11 |
| 13 | + |
| 14 | +## Installation |
| 15 | + |
| 16 | +### via Ansible-galaxy |
| 17 | +The netscaler.adc collection can be installed with the Ansible Galaxy command-line tool: |
| 18 | + |
| 19 | +```bash |
| 20 | +ansible-galaxy collection install netscaler.adc |
| 21 | +``` |
| 22 | + |
| 23 | +### via github (to have the latest updated which are yet to be released in ansible-galaxy) |
| 24 | + |
| 25 | +```bash |
| 26 | +ansible-galaxy collection install "git+https://github.com/netscaler/ansible-collection-netscaleradc.git" [--force] |
| 27 | +``` |
| 28 | + |
| 29 | +> `--force` option is required if you have already installed the collection via ansible-galaxy. This will overwrite the existing collection with the latest collection from github. |
| 30 | +
|
| 31 | +To verify the installation, run the following command: |
| 32 | + |
| 33 | +```bash |
| 34 | +ansible-galaxy collection list netscaler.adc |
| 35 | +``` |
| 36 | + |
| 37 | +The above command should display the below output: |
| 38 | + |
| 39 | +```text |
| 40 | +
|
| 41 | +# /Users/netscaleruser/.ansible/collections/ansible_collections |
| 42 | +Collection Version |
| 43 | +------------- ------- |
| 44 | +netscaler.adc 2.8.x |
| 45 | +``` |
| 46 | + |
| 47 | +## Usecases |
| 48 | + |
| 49 | +The modules can be called by their Fully Qualified Collection Name (FQCN) such as `netscaler.adc.lbvserver`, or by their short name `netscaler.adc` if the collection is listed under the playbook's `collections` attribute: |
| 50 | + |
| 51 | +### Usecase by FQCN |
| 52 | +```yaml |
| 53 | +--- |
| 54 | +- name: Sample lbvserver playbook |
| 55 | + hosts: demo_netscalers |
| 56 | + gather_facts: false |
| 57 | + tasks: |
| 58 | + - name: Configure lbvserver |
| 59 | + delegate_to: localhost |
| 60 | + netscaler.adc.lbvserver: |
| 61 | + nsip: "{{ nsip }}" |
| 62 | + nitro_user: "{{ nitro_user }}" |
| 63 | + nitro_pass: "{{ nitro_pass }}" |
| 64 | + nitro_protocol: "{{ nitro_protocol }}" |
| 65 | + validate_certs: false |
| 66 | + save_config: false |
| 67 | + state: present |
| 68 | + name: lb_dns_01 |
| 69 | + servicetype: HTTP |
| 70 | +``` |
| 71 | +
|
| 72 | +### Usecase by declaring collection |
| 73 | +
|
| 74 | +```yaml |
| 75 | +--- |
| 76 | +- name: Sample lbvserver playbook |
| 77 | + hosts: demo_netscalers |
| 78 | + gather_facts: false |
| 79 | + collections: |
| 80 | + - netscaler.adc |
| 81 | + tasks: |
| 82 | + - name: Configure lbvserver |
| 83 | + delegate_to: localhost |
| 84 | + lbvserver: |
| 85 | + nsip: "{{ nsip }}" |
| 86 | + nitro_user: "{{ nitro_user }}" |
| 87 | + nitro_pass: "{{ nitro_pass }}" |
| 88 | + nitro_protocol: "{{ nitro_protocol }}" |
| 89 | + validate_certs: false |
| 90 | + save_config: false |
| 91 | + name: lb_dns_01 |
| 92 | + servicetype: HTTP |
| 93 | + |
| 94 | +``` |
| 95 | +### Usecase by `netscaler.adc.module_default` group |
| 96 | + |
| 97 | +```yaml |
| 98 | +--- |
| 99 | +- name: Sample Playbook to use module_defaults to specify common arguments |
| 100 | + hosts: localhost |
| 101 | + gather_facts: false |
| 102 | + module_defaults: |
| 103 | + group/netscaler.adc.default_args: |
| 104 | + nsip: 10.10.10.10 |
| 105 | + nitro_user: nsroot |
| 106 | + nitro_pass: verysecretpassword |
| 107 | + nitro_protocol: http |
| 108 | + validate_certs: false |
| 109 | + save_config: false |
| 110 | + tasks: |
| 111 | + - name: Sample Task | ipset |
| 112 | + delegate_to: localhost |
| 113 | + netscaler.adc.lbvserver: |
| 114 | + name: lb_dns_01 |
| 115 | + servicetype: HTTP |
| 116 | +``` |
| 117 | +
|
| 118 | +### Authentication |
| 119 | +
|
| 120 | +#### Authenticate to NetScaler via username and password |
| 121 | +
|
| 122 | +Every module in the collection requires the user to authenticate to the NetScaler ADC appliance. To authenticate, provide the `nsip`, `nitro_user` and `nitro_pass` parameters directly or set them using environment variables `NETSCALER_NSIP`, `NETSCALER_NITRO_USER` and `NETSCALER_NITRO_PASS`. |
| 123 | + |
| 124 | +Refer to the [playbook_anatomy.md](https://github.com/netscaler/ansible-collection-netscaleradc/blob/c8c77cb4cb3905af8b90992bc55519f9a513ed08/playbook_anatomy.md#L4) and [examples](https://github.com/netscaler/ansible-collection-netscaleradc/tree/c8c77cb4cb3905af8b90992bc55519f9a513ed08/examples) directory for the sample playbooks. |
| 125 | + |
| 126 | + |
| 127 | +### Invocation |
| 128 | + |
| 129 | +The credentials of the netscaler can be provided either in the playbook by hardcoding or defining in a inventory.ini file. |
| 130 | + |
| 131 | +#### Execution command when hosts are declared in playbook: |
| 132 | + |
| 133 | +``` |
| 134 | +ansible-playbook playbook.yaml [--verbose] |
| 135 | +``` |
| 136 | +
|
| 137 | +#### Execution command hosts are declared in an inventory file: |
| 138 | +
|
| 139 | +``` |
| 140 | +ansible-playbook playbook.yaml -i inventory.ini [--verbose] |
| 141 | +``` |
| 142 | +
|
| 143 | +## Testing |
| 144 | +The collection is tested using Github Actions. To know more about testing, please refer the [link]([https://github.com/netscaler/ansible-collection-netscaleradc/.github/workflow) to know more. |
| 145 | +
|
| 146 | +## Contributing |
| 147 | +
|
| 148 | +For external contributions, refer the [guidelines](https://github.com/netscaler/ansible-collection-netscaleradc/blob/c8c77cb4cb3905af8b90992bc55519f9a513ed08/CONTRIBUTING.md#L4). |
| 149 | +
|
| 150 | +## Support |
| 151 | +For issues : [Issues](https://github.com/netscaler/ansible-collection-netscaleradc/issues) |
| 152 | +
|
| 153 | +For discussions or feature requests: [Discussions or feature request](https://github.com/netscaler/ansible-collection-netscaleradc/issues) |
| 154 | +
|
| 155 | +
|
| 156 | +## Release Notes |
| 157 | +
|
| 158 | +Please refer to the [link](https://github.com/netscaler/ansible-collection-netscaleradc/blob/0438f3253b2eca084760984b6564a0a7964a128d/CHANGELOG.md) for the release notes. |
| 159 | +
|
| 160 | +## License Information |
| 161 | +
|
| 162 | +The collection uses MIT License. You can refer the [link](https://github.com/netscaler/ansible-collection-netscaleradc/blob/0438f3253b2eca084760984b6564a0a7964a128d/LICENSE) to view license information. |
0 commit comments