Git Product home page Git Product logo

f5-ansible's Introduction

f5

CI CI

Ansible role, which makes managing F5 boxes (physical/virtual) little bit less painful, by adding some logic to existing ansible F5 modules

How to make it work

Docker version (recommended)

Extra GitHub repository VeselaHouba/f5-docker with docker wrapper has been created to ease your pain. Check this URL and then come back for detailed explanation of how to define your variables.

Virtualenv version (deprecated)

If you don't want to mess with your default env, install everything in virtualenv. It might be good idea to actually wrap everything in docker.

pip install vitualenv
virtualenv ansible-dev
source ansible-dev/bin/activate
pip install --user f5-sdk
pip install git+https://github.com/ansible/ansible.git@devel

Next time you just need to activate it again

source ansible-dev/bin/activate

Variables and files explained

Role Variables

Check default values in defaults/main.yml. This project is currently under heavy development, so documentation is not maintained. It will be filled once the project changes settle down.

iRules

You can define path for iRule relative to your playbook

f5_iRules_list:
  - { name: irule_ib-block_ip, file: ../files/iRules/irule_ib-block_ip.tcl}

Or use one of predefined iRules inside this role files/iRules/ and reference only by it's name

f5_iRules_list:
  - { name: irule_example }

iApps

Upload templates and create instances (services) of iApps. You have to check insides of the iApp template to check variables names. (You're basically bypassing the visual part of iApp)

Following is example of iApp to periodically update CRL from public site.

f5_iApps_templates:
  - name: automated_crl_update
    path: ../files/iApps/automated_crl_update.tmpl
    state: present

f5_iApps_services:
  - name: update_crl_from_ICA
    template: automated_crl_update
    state: present
    parameters:
      variables:
        - name: "crl_configuration__name"
          value: "ICA_crl"
        - name: crl_configuration__interval
          value: 3600
      tables:
        - name: "crl_configuration__url_list"
          columnNames:
            - url
          rows:
            - row:
                - http://qcrldp1.ica.cz/rca15_rsa.crl

Partitions

If you want to use specific partitions, then you have to define absolute paths to cross-partition resources. Only resources in the same partition are searched without prefix.

f5_partitions:
  - name: test_part
    description: testing partition

f5_virtual_servers:
  - name: part_test
    destination: 10.0.0.1
    port: 80
    pool: pool_part_test
    profiles:
      - /Common/some_profile
      - name: /Common/other_profile
        context: client-side
      - name: /Common/tcp-wan-optimized
        context: client-side
      - name: /Common/tcp-lan-optimized
        context: server-side
    enabled_vlans:
      - /Common/some_vlan
    irules:
      - /Common/some_irule_in_common
      - some_irule_in_test_part
    partition: test_part

Partial Deploy

This feature was added to support ability to deploy only some parts of infrastructure. For example if you want to deploy only single virtual host, put it's name to f5_partial_deploy variable. Module will then skip all tasks except virtual host deploy. Any supported name can be used: iRule, username, pool name, profile, ...

Examples:

# single virtual server
ansible-playbook playbooks/deploy.yml -e "f5_partial_deploy=my_virtual_server"
# multiple items
ansible-playbook playbooks/deploy.yml -e "f5_partial_deploy=my_virtual_server,my_pool"

You can also add your variables to file and load it from command-line

$ cat f5_partial_deploy.yml

---
f5_partial_deploy:
  - my_pool
  - my_virtual_server
  - my_http_profile
  - my_asm_profile

ansible-playbook playbooks/deploy.yml -e @f5_partial_deploy.yml

Profiles

Rewrite profile

F5 official modules don't provide rewrite profile deploy function (yet), so implementation in python is in library. Credits @erjac77

- name: profile_rewrite_01
  type: rewrite
  rewrite_mode: uri-translation
  uri_rules:
    - name: test
      type: both
      client:
        path: /old_path/
      server:
        path: /old_path/

License

BSD

Author Information

Jan Michalek (michalek_at_m-cloud.cz)

f5-ansible's People

Contributors

veselahouba avatar

Watchers

James Cloos avatar  avatar

f5-ansible's Issues

Broken logs on skipped tasks

TASK [f5 : Publish LTM policy for ASM policy {{ virtual_server.asm_policy }}] *********************************************************************************
Wednesday 17 February 2021  11:20:42 +0000 (0:00:00.053)       0:11:52.075 ****
skipping: 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.