|
1 | 1 | # NetScaler ADC Ansible Collection Migration Tool |
2 | 2 |
|
3 | | -Migrates Ansible playbooks from legacy `citrix.adc` collection to new `netscaler.adc` collection format. |
| 3 | +This tool helps migrate existing Ansible playbooks from the legacy `citrix.adc` collection to the new `netscaler.adc` collection format. |
4 | 4 |
|
5 | | -## Usage |
| 5 | +## Overview |
6 | 6 |
|
7 | | -```bash |
8 | | -python3 convert_yaml.py -i input_playbook.yaml -o output_playbook.yaml |
9 | | -``` |
| 7 | +The migration tool converts YAML playbooks that use: |
| 8 | +- Legacy `citrix.adc` modules |
| 9 | +- `citrix_adc_nitro_request` generic module |
10 | 10 |
|
11 | | -**Arguments:** |
12 | | -- `-i, --input`: (Required) Input YAML playbook |
13 | | -- `-o, --output`: (Optional) Output file (defaults to `output.yaml`) |
14 | | -- `-v, --verbose`: (Optional) Enable verbose output |
| 11 | +Into playbooks that use the new `netscaler.adc` collection modules. |
15 | 12 |
|
16 | | -## What it converts |
| 13 | +## Features |
17 | 14 |
|
18 | | -1. **Legacy modules**: `citrix.adc.lbvserver` → `netscaler.adc.lbvserver` |
19 | | -2. **NITRO requests**: `citrix_adc_nitro_request` → specific resource modules |
| 15 | +- **Module Mapping**: Automatically maps legacy module names to new collection modules |
| 16 | +- **State Conversion**: Converts NITRO request operations to appropriate state values |
| 17 | +- **Credential Handling**: Preserves and converts authentication parameters |
| 18 | +- **YAML Structure Preservation**: Maintains playbook structure, variables, and task organization |
20 | 19 |
|
21 | | -### Example Conversion |
| 20 | +## Usage |
22 | 21 |
|
23 | | -**Before:** |
24 | | -```yaml |
25 | | -- name: Configure LB vserver |
26 | | - citrix_adc_nitro_request: |
27 | | - operation: present |
28 | | - resource: lbvserver |
29 | | - name: my_lb_vserver |
30 | | - attributes: |
31 | | - servicetype: HTTP |
32 | | - port: 80 |
33 | | -``` |
| 22 | +### Basic Usage |
34 | 23 |
|
35 | | -**After:** |
36 | | -```yaml |
37 | | -- name: Configure LB vserver |
38 | | - netscaler.adc.lbvserver: |
39 | | - state: present |
40 | | - name: my_lb_vserver |
41 | | - servicetype: HTTP |
42 | | - port: 80 |
| 24 | +```bash |
| 25 | +python3 convert_yaml.py -i input_playbook.yaml -o output_playbook.yaml |
43 | 26 | ``` |
44 | 27 |
|
45 | | -## Requirements |
| 28 | +### Arguments |
| 29 | + |
| 30 | +- `-i, --input`: (Required) Path to the input YAML playbook |
| 31 | +- `-o, --output`: (Optional) Path for the output file. Defaults to `output.yaml` |
| 32 | + |
| 33 | +### Example |
46 | 34 |
|
47 | 35 | ```bash |
48 | | -pip install pyyaml jinja2 |
| 36 | +python convert_yaml.py -i legacy_playbook.yml -o migrated_playbook.yml |
49 | 37 | ``` |
50 | 38 |
|
51 | | -## Files |
| 39 | +## Supported Conversions |
52 | 40 |
|
53 | | -- `convert_yaml.py`: Main conversion script |
54 | | -- `resourcelist.py`: Module and state mappings |
| 41 | +### Legacy Module Mappings |
| 42 | +The tool uses `resource_map` to convert legacy module names to new collection modules: |
| 43 | +- `citrix.adc.lbvserver` → `netscaler.adc.lbvserver` |
| 44 | +- `lbvserver` → `netscaler.adc.lbvserver` |
| 45 | + |
| 46 | +### NITRO Request Conversion |
| 47 | +Converts `citrix_adc_nitro_request` tasks to specific resource modules: |
| 48 | + |
| 49 | +**Before:** |
| 50 | +```yaml |
| 51 | +- name: Configure LB vserver |
| 52 | + citrix_adc_nitro_request: |
| 53 | + nsip: "{{ nsip }}" |
| 54 | + nitro_user: "{{ nitro_user }}" |
55 | 55 | nitro_pass: "{{ nitro_pass }}" |
56 | 56 | operation: present |
57 | 57 | resource: lbvserver |
|
0 commit comments