Hi,

I have playbook for fortios and working.
But is that possible
1. I don't want to put password in playbook, but put that in 
group_vars/forti.yml
2. In cisco I can apply playbook to group name in hosts
i.e.
# cat playbooks/cisco.yml
---
- name: show
  connection: network_cli
  hosts: cisco
INSTEAD OF
---
- name: show
  connection: network_cli
  hosts: cisco1

How to do the same in fortios

# cat ../hosts
[cisco]
cisco1 ansible_host=10.0.10.121

[forti]
fgt1 ansible_host=10.0.10.123

# cat playbooks/forti.yml
---
- name: fortios command
  connection: local
  hosts: forti
  tasks:
    - name: backup
      fortios_config:
        host: fgt1
        username: admin
        password: admin
        backup: yes
        backup_path: "backup/forti"
        backup_filename: 
"{{inventory_hostname}}_{{ansible_date_time.date}}.cfg"

    - name: dns
      fortios_address:
        host: fgt1
        username: admin
        password: admin
        state: present
        name: "google_dns"
        type: ipmask
        value: 8.8.8.8

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0cc888cf-1d34-429c-9678-8a2c521d9cff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to