def METHOD_NAME(target_sat):
    """
    Test add and remove functionality for ansible roles in hostgroup via cli
    :id: 2c6fda14-4cd2-490a-b7ef-7a08f8164fad
    :customerscenario: true
    :Steps:
        1. Create a hostgroup
        2. Sync few ansible roles
        3. Assign a few ansible roles with the host group
        4. Add some ansible role with the host group
        5. Remove the added ansible roles from the host group
    :expectedresults:
        1. Ansible role assign/add/remove functionality should work as expected in cli
    :BZ: 2029402
    :CaseAutomation: Automated
    """
    ROLES = [
        'theforeman.foreman_scap_client',
        'redhat.satellite.hostgroups',
        'RedHatInsights.insights-client',
    ]
    proxy_id = target_sat.nailgun_smart_proxy.id
    hg_name = gen_string('alpha')
    result = target_sat.cli.HostGroup.create({'name': hg_name})
    assert result['name'] == hg_name
    target_sat.cli.Ansible.roles_sync({'role-names': ROLES, 'proxy-id': proxy_id})
    result = target_sat.cli.HostGroup.ansible_roles_assign(
        {'name': hg_name, 'ansible-roles': f'{ROLES[1]},{ROLES[2]}'}
    )
    assert 'Ansible roles were assigned to the hostgroup' in result[0]['message']
    result = target_sat.cli.HostGroup.ansible_roles_add({'name': hg_name, 'ansible-role': ROLES[0]})
    assert 'Ansible role has been associated.' in result[0]['message']
    result = target_sat.cli.HostGroup.ansible_roles_remove(
        {'name': hg_name, 'ansible-role': ROLES[0]}
    )
    assert 'Ansible role has been disassociated.' in result[0]['message']