---
- name: Test we can write any other configuration file
  hosts: all
  tasks:
    - name: Run role
      include_role:
        name: redhat.rhel_system_roles.ssh
      vars:
        ssh:
          Compression: true
          GSSAPIAuthentication: false
        ssh_config_file: /tmp/ssh_config
        ssh_skip_defaults: true

    - name: Verify the configuration file was created in the right place
      block:
        - name: Download the custom configuration file
          slurp:
            src: /tmp/ssh_config
          register: config

        - name: Verify the options are in the file
          assert:
            that:
              - "'Compression yes' in config.content | b64decode"
              - "'GSSAPIAuthentication no' in config.content | b64decode"
            # common defaults should be skipped (ssh_skip_defaults=true)
              - "'Include' not in config.content | b64decode"
              - "'SendEnv' not in config.content | b64decode"
