Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fortios_export_config_playbook - system_settings selector not working #322

Open
dominicfillmore opened this issue Jun 24, 2024 · 4 comments

Comments

@dominicfillmore
Copy link

I have a playbook that can access loads of other selectors fine, but if I try system_settings selector, I get an error - "The error was: AttributeError: 'list' object has no attribute 'split'"

@MaxxLiu22
Copy link

Hi @dominicfillmore ,

Thank you for raising this issue, I can reproduce that, and have reported it to the dev team for fixing.

Thanks,
Maxx

@MaxxLiu22
Copy link

Hi @dominicfillmore ,

We just released Ansible FOS 2.3.7. This issue should be fixed, so you could upgrade to it and give it a try at your convenience.

ansible-galaxy collection install fortinet.fortios:2.3.7

Thanks,
Maxx

@dominicfillmore
Copy link
Author

Thanks Maxx, This runs now. Whatever VDOM I specify in the playbook I run, the resulting playbook that this on generates will always have the values for the VDOM I specified, but have "vdom: root" in the vars. I've noticed this with quite a few of the other selectors. Is this on purpose or a bug? Ideally I should be able to run the playbook this generates without modification to restore whatever selectors I specify when I run it

@MaxxLiu22
Copy link

Hi @dominicfillmore ,

We have improved this aspect. Since the exported playbook is a hardcoded template except for the tasks section, it may cause confusion. In the latest Ansible FOS collections, we have highlighted the customized parts that customers need to specify. Let me know if you still have quesitons.

- hosts: YOUR_OWN_VALUE
  collections:
  - fortinet.fortios
  connection: httpapi
  gather_facts: YOUR_OWN_VALUE
  vars:
    vdom: YOUR_OWN_VALUE   <--------------------
    ansible_httpapi_use_ssl: 'true'
    ansible_httpapi_validate_certs: 'false'
    ansible_httpapi_port: YOUR_OWN_VALUE
  tasks:
  - fortios_system_settings:
      vdom: '{{ vdom }}'
      access_token: '{{ fortios_access_token }}'
      state: present
      system_settings:
        comments: ''
        vdom_type: traffic
        lan_extension_controller_addr: ''
        opmode: nat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants