ansible 上的 F5 集成

F5 integration on ansible

到目前为止,我使用的是Ansible的核心模块。

现在我也会玩Extra Module。假设我想在我的剧本上使用:bigip_partition。 我看到它在 https://github.com/F5Networks/f5-ansible/tree/master/library

谁能告诉我如何安装它们? 我在 Ubuntu 14LTS,Ansible 2.2

目前:

> sudo pip install bigsuds --upgrade pip 
> sudo pip install f5-sdk 
> sudo pip install git+https://github.com/F5Networks/f5-ansible.git -vvv
Collecting git+https://github.com/F5Networks/f5-ansible.git
  Cloning https://github.com/F5Networks/f5-ansible.git to /tmp/pip-NjrWJw-build
  Running command git clone -q https://github.com/F5Networks/f5-ansible.git /tmp/pip-NjrWJw-build
  Running setup.py (path:/tmp/pip-NjrWJw-build/setup.py) egg_info for package from git+https://github.com/F5Networks/f5-ansible.git
    Running command python setup.py egg_info
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: '/tmp/pip-NjrWJw-build/setup.py'
Cleaning up...
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-NjrWJw-build/
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 707, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-NjrWJw-build/

谢谢, 里卡多

https://github.com/F5Networks/f5-ansible 不是 python 包,不要尝试用 pip 安装它。
要使用这些模块,您只需将 library 中的 py 文件放入 playbook-path/library.

如果您在 BIG-IP 上安装 'App Services 3.0' (AS3) 声明式接口,您将获得更好的体验: https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/3/

然后您只需发送 'declarations' 您想要的状态,而不是使用许多命令式接口...

这里有一些示例声明(在 Ansible 中使用 Jinja2 模板很容易 generate/manipulate): https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/3/userguide/examples.html