Fortinet black logo

Administration Guide

Running your first playbook

Running your first playbook

For each of the Ansible Collection modules, an example playbook is provided. For example, to get the details of the FortiFlex program:

- name: Get list of VM Programs for the account
  hosts: localhost
  collections:
    - fortinet.fortiflexvm
  vars:
    username: "<your_own_value>"
    password: "<your_own_value>"
  tasks:
    - name: Get programs list
      fortinet.fortiflexvm.fortiflexvm_programs_list_info:
        username: "{{ username }}"
        password: "{{ password }}"
      register: result

    - name: Display response
      debug:
        var: result.programs

Options that need specific input include:

collections

The namespace must be fortinet.fortiflexvm.

username

Must be specified in the playbook or the FLEXVM_ACCESS_USERNAME environment variable. See FortiFlex API for information on getting a username.

password

Must be specified in the playbook or the FLEXVM_ACCESS_PASSWORD environment variable. See FortiFlex API for information on getting a password.

Running your first playbook

For each of the Ansible Collection modules, an example playbook is provided. For example, to get the details of the FortiFlex program:

- name: Get list of VM Programs for the account
  hosts: localhost
  collections:
    - fortinet.fortiflexvm
  vars:
    username: "<your_own_value>"
    password: "<your_own_value>"
  tasks:
    - name: Get programs list
      fortinet.fortiflexvm.fortiflexvm_programs_list_info:
        username: "{{ username }}"
        password: "{{ password }}"
      register: result

    - name: Display response
      debug:
        var: result.programs

Options that need specific input include:

collections

The namespace must be fortinet.fortiflexvm.

username

Must be specified in the playbook or the FLEXVM_ACCESS_USERNAME environment variable. See FortiFlex API for information on getting a username.

password

Must be specified in the playbook or the FLEXVM_ACCESS_PASSWORD environment variable. See FortiFlex API for information on getting a password.