Initial commit of wif2ansible
This commit is contained in:
58
README.md
Normal file
58
README.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# WIF to Ansible Inventory Converter
|
||||
|
||||
This tool converts **Workload Intake Form (WIF)** Excel documents into **Ansible Inventory** YAML files.
|
||||
|
||||
## Features
|
||||
- **Robust Excel Parsing**: Automatically handles shifted cells and ignores hidden headers/rows/columns.
|
||||
- **Server Filtering**: Only generates flows for servers explicitly defined in the 'Servers' tab.
|
||||
- **Strict Validation**: Dropped flows are reported in the console output.
|
||||
|
||||
## How to Run
|
||||
|
||||
### Option 1: Standalone Executable (Windows)
|
||||
No Python installation required.
|
||||
|
||||
1. Navigate to the `dist` folder.
|
||||
2. Run the executable from the command line, providing your WIF Excel file as an argument:
|
||||
|
||||
```powershell
|
||||
.\dist\wif2ansible.exe "Path\To\Your_WIF.xlsx"
|
||||
```
|
||||
|
||||
The inventory file (e.g., `inventory_YYYY-MM-DD_HHMM.yml`) will be generated in the current directory.
|
||||
|
||||
**Optional: Specify Output File**
|
||||
```powershell
|
||||
.\dist\wif2ansible.exe "Path\To\Your_WIF.xlsx" -o "my_inventory.yml"
|
||||
```
|
||||
|
||||
### Option 2: Run via Python Source
|
||||
If you are developing or prefer running the raw script:
|
||||
|
||||
1. **Install Requirements**:
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
2. **Run Module**:
|
||||
```bash
|
||||
python -m wif2ansible.main "Path\To\Your_WIF.xlsx"
|
||||
```
|
||||
|
||||
## Requirements for WIF Excel File
|
||||
- Must contain a **Servers** tab (e.g., "B.Server Info") with columns for `Reference`, `Platform`, and `IP Address`.
|
||||
- Must contain **Flow** tabs (e.g., "F.Dataflow - Application") with headers for `Source`, `Destination`, and `Port`.
|
||||
- **Hidden rows and columns are strictly ignored**. Ensure valid data is visible.
|
||||
|
||||
## Output
|
||||
Generates a YAML file compatible with Ansible:
|
||||
```yaml
|
||||
all:
|
||||
hosts:
|
||||
192.168.1.10:
|
||||
ansible_connection: winrm
|
||||
flows:
|
||||
- dest: 10.0.0.5
|
||||
ports: [80, 443]
|
||||
protocol: tcp
|
||||
```
|
||||
Reference in New Issue
Block a user