Creator function for creating an instance of an Ansible script.

def creator(entry, config):
        """Creator function for creating an instance of an Ansible script."""
        ansible_playbook = "ansible.playbook.dry.run.see.comment"
        ansible_inventory = "ansible.inventory.dry.run.see.comment"

        ansible_playbook_content = render(config.script, model=config.model, env=config.env,
                                          variables=config.variables, item=config.item)
        ansible_inventory_content = render(entry['inventory'], model=config.model, env=config.env,
                                           variables=config.variables, item=config.item)

        if not config.dry_run:
            ansible_playbook = write_temporary_file(ansible_playbook_content, 'ansible-play-', '.yaml')
            ansible_playbook_content = ''
            ansible_inventory = write_temporary_file(ansible_inventory_content, prefix='ansible-inventory-')
            ansible_inventory_content = ''

        # rendering the Bash script for running the Ansible playbook
        template_file = os.path.join(os.path.dirname(__file__), 'templates/ansible.sh.j2')
        with open(template_file) as handle:
            template = handle.read()
            config.script = render(template, debug=config.debug,
                                   ansible_playbook_content=ansible_playbook_content,
                                   ansible_playbook=ansible_playbook,
                                   ansible_inventory_content=ansible_inventory_content,
                                   ansible_inventory=ansible_inventory,
                                   limit=entry['limit'])

        return Ansible(config)