项目作者: mminichino

项目描述 :
Ansible Playbooks
高级语言: Python
项目地址: git://github.com/mminichino/ansible-playbooks.git
创建时间: 2020-05-31T03:19:41Z
项目社区:https://github.com/mminichino/ansible-playbooks

开源协议:

下载


ansible-playbooks

Ansible Playbooks and NetApp Ansible Samples

The ansible helper allows you to run a playbook and pass in variables on the command line. This can be done directly with ansible-playbook and the Extra Vars option, but this program makes this process more user friendly. You define the external variables in specially crafted comments (# var:var_name). You can then pass these via long style arguments as —var_name. If you combine this with “if defined else” variable constructs you can set default values and pass only the needed variables through the helper program.

  1. $ mkdir $HOME/playbooks
  2. $ cd playbooks
  3. $ git clone mminichino/ansible-playbooks
  4. $ ./ansible-helper.py mount_ontap_nfs_share.yaml --cluster_admin_ip w.x.y.z --vol_aggregate aggr1 --vol_size 100 --svm_name svm0 --nfs_lif w.x.y.z --mount_point /u01 --mount_owner oracle --mount_group dba --vol_name orabin --host_group database

To see supported variables, use the print option:

  1. $ ./ansible-helper.py mount_ontap_nfs_share.yaml -p
  2. --cluster_admin_ip
  3. --vol_aggregate
  4. --vol_name
  5. --vol_size
  6. --export_policy
  7. --svm_name
  8. --mount_point
  9. --mount_owner
  10. --mount_group
  11. --nfs_lif
  12. --nfs_options
  13. --host_group

To see verbose Ansible output, use the -d option, and to do a dry run use the -c option.

You can save variable values to quickly replay a scenario with a specific playbook. You will be prompted for each parameter, and you can enter a value for that parameter that will be saved. Just hit enter if you don’t want to save a value for that parameter. You will also be asked if you want to be prompted on replay to edit the saved value. If you select “y” then before the scenario is replayed, you will have a chance to edit that parameter.

  1. $ ./ansible-helper.py ontap_incr_merge_clone.yaml -s testdb_copy

To replay a scenario that was previously saved:

  1. $ ./ansible-helper.py ontap_incr_merge_clone.yaml -r testdb_copy