{"id":42082281,"url":"https://github.com/cloudify-cosmo/cloudify-ansible-plugin","last_synced_at":"2026-01-26T10:07:31.034Z","repository":{"id":24555136,"uuid":"27962223","full_name":"cloudify-cosmo/cloudify-ansible-plugin","owner":"cloudify-cosmo","description":"Runs ansible inside of the Cloudify Manager","archived":false,"fork":false,"pushed_at":"2024-03-21T17:46:52.000Z","size":690,"stargazers_count":8,"open_issues_count":2,"forks_count":17,"subscribers_count":39,"default_branch":"master","last_synced_at":"2024-04-14T07:31:31.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudify-cosmo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-12-13T14:00:55.000Z","updated_at":"2024-01-17T11:12:31.000Z","dependencies_parsed_at":"2023-11-22T13:44:15.498Z","dependency_job_id":"bccab849-4fe2-4c70-8ded-b8109a4700ca","html_url":"https://github.com/cloudify-cosmo/cloudify-ansible-plugin","commit_stats":null,"previous_names":[],"tags_count":66,"template":false,"template_full_name":null,"purl":"pkg:github/cloudify-cosmo/cloudify-ansible-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-ansible-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-ansible-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-ansible-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-ansible-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudify-cosmo","download_url":"https://codeload.github.com/cloudify-cosmo/cloudify-ansible-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudify-cosmo%2Fcloudify-ansible-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28774299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T09:42:00.929Z","status":"ssl_error","status_checked_at":"2026-01-26T09:42:00.591Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-26T10:07:30.044Z","updated_at":"2026-01-26T10:07:31.028Z","avatar_url":"https://github.com/cloudify-cosmo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudify Ansible Plugin\n\nThe Ansible plugin enables you to configure Cloudify resources with Ansible\nand provides an agentless method for executing operations on remote hosts.\n\n## Playbook Run Operation\n\nSimilar to the Script Plugin and the Fabric Plugin, there is no one node type\nassociated with the Ansible plugin. Instead, you modify existing node types to\nperform one or more of their lifecycle operations using the Ansible plugin and\nany additional inputs that you provide.\n\n## Node types\n\n### cloudify.nodes.ansible.Executor\n\nAnsible Playbook Executor Node uses\n[ansible.cloudify_ansible.tasks.run](#ansiblecloudify_ansibletasksrun) as `start`\naction.\n\n**Properties:**\n* `site_yaml_path`: A path to your `site.yaml` or `main.yaml` in your Ansible\n  Playbook.\n* `sources`: Your Inventory sources. Either YAML or a path to a file. If not\n  provided the inventory will be take from the `sources` runtime property.\n* `run_data`: Variable values.\n* `options_config`: Command-line options, such as `tags` or `skip_tags`.\n* `ansible_env_vars`: A dictionary of environment variables to set.\n  Default is `{\"ANSIBLE_HOST_KEY_CHECKING\": \"False\"}`.\n* `debug_level`: Debug level.\n\n**NOTE** there is a special handling for \"ANSIBLE_FACT_PATH\" environment variable, where you could add custom `.fact` files -which could be executable that Ansible expect JSON on stdout. If you include files that are not executable and simply contain raw JSON then Ansible will just read them and use the data inside - when gather facts is triggered they will be part of `runtime_properties.facts.ansible_local.{fact_file_name}`\n\nFor example you could do something like this inside your playbook:\n\n```yaml\n- hosts: all\n  connection: local\n\n  tasks:\n\n    - name: \"Set fact: output dictionary\"\n      set_fact:\n        output_dict:\n          just_a_test: \"my value from ansible gathered fact !!\"\n\n    - name: \"Creates facts directory if it doesn't exist\"\n      file:\n        path: \"{{ lookup('ansible.builtin.env', 'ANSIBLE_FACT_PATH') }}\"\n        state: directory\n\n    - name: \"Insert custom fact file\"\n      copy:\n        content: \"{{ output_dict | to_nice_json }}\"\n        dest: \"{{ lookup('ansible.builtin.env', 'ANSIBLE_FACT_PATH') }}/custom.fact\"\n        mode: 0644\n```\n\n\n## Operations\n\n### ansible.cloudify_ansible.tasks.run\n\nExecute the equivalent of `ansible-playbook` on the Ansible Playbook provided\nin the `site_yaml_path` input.\n\n**Inputs:**\n* `site_yaml_path`: A path to your `site.yaml` or `main.yaml` in your\n  Ansible Playbook.\n* `sources`: Your Inventory sources. Either YAML or a path to a file.\n  If not provided the inventory will be take from the `sources`\n  runtime property.\n* `run_data`: Variable values.\n* `options_config`: Command-line options, such as `tags` or `skip_tags`.\n* `ansible_env_vars`: A dictionary of environment variables to set.\n* `debug_level`: Debug level, Default is 2.\n\nIn addition, you can provide additional key-word args parameters to the\n`AnsiblePlaybookFromFile` class, such as `options_config`.\n\n## Inventory Sources\n\n**There are also two methods for generating the sources parameter\nautomatically, see [using compute nodes](#using-compute-nodes) and\n[Relationships](#using-relationships).**\n\nFor all inventory sources, we require these parameters:\n* `ansible_host`: The hostname or IP address of the host to SSH into.\n* `ansible_user`: The username to SSH with.\n* `ansible_ssh_private_key_file`: The private key file to SSH with.\n\nIn addition, we handle these parameters if provided (and highly recommend them):\n* `ansible_become`: A boolean value, `true` or `false` whether to assume the\n  user privileges.\n* `ansible_ssh_common_args`: Additional arguments to the SSH command like,\n  we suggest, `'-o StrictHostKeyChecking=no'`.\n\nFor more information on the sources format in YAML, see\n[Ansible Inventory YAML](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#hosts-and-groups).\n\n\n## Using Compute Nodes\n\nIf your operation is mapped on the lifecycle operation of a node template\nderived from `cloudify.nodes.Compute`, we will attempt to generate the `sources`\nparameter from the node properties.\n\n### Example Compute Node\n\nProvision some component on a VM.\n\n```yaml\n  compute_and_component:\n    type: cloudify.nodes.Compute\n    properties:\n      ip: { get_input: ip }\n      agent_config:\n        install_method: none\n        key: { get_input: private_key_path }\n        user: { get_input: username }\n    interfaces:\n      cloudify.interfaces.lifecycle:\n        start:\n          implementation: ansible.cloudify_ansible.tasks.run\n          inputs:\n            site_yaml_path: resources/component/site.yaml\n```\n\n\n## Using Relationships\n\nUse the `cloudify.ansible.relationships.connected_to_host` relationship defined\nin the plugin to populate the sources parameter, if the target node is derived\nfrom `cloudify.nodes.Compute`.\n\n**Inputs:**\n* `group_name`: Ansible node group name\n* `hostname`: Hostname\n* `host_config`: Host configuration:\n  * `ansible_host`: The hostname or IP address of the host to SSH into.\n  * `ansible_user`: The username to SSH with.\n  * `ansible_ssh_private_key_file`: The private key file to SSH with.\n  * `ansible_become`: A boolean value, `true` or `false` whether to assume the\n    user privileges.\n  * `ansible_ssh_common_args`: Additional arguments to the SSH command,\n    by default: '-o StrictHostKeyChecking=no'\n\n### Example Relationship Usage\n\n```yaml\n  component:\n    type: cloudify.nodes.Root\n    interfaces:\n      cloudify.interfaces.lifecycle:\n        start:\n          implementation: ansible.cloudify_ansible.tasks.run\n          inputs:\n            site_yaml_path: resources/component/site.yaml\n            sources: { get_attribute: [ SELF, sources ] }\n    relationships:\n      - type: cloudify.ansible.relationships.connected_to_host\n        target: compute\n\n  compute:\n    type: cloudify.nodes.Compute\n    properties:\n      ip: { get_input: ip }\n      agent_config:\n        install_method: none\n        key: { get_input: private_key_path }\n        user: { get_input: username }\n```\n\n\n## More Examples\n\nBasic usage with no special node or relationship type behavior.\n\n```yaml\n  my_node:\n    type: cloudify.nodes.Root\n    interfaces:\n      cloudify.interfaces.lifecycle:\n        create:\n          implementation: ansible.cloudify_ansible.tasks.run\n          inputs:\n            site_yaml_path: resources/my_ansible_playbook/site.yaml\n            sources:\n              webservers:\n                hosts:\n                  web:\n                    ansible_host: { get_input: ip }\n                    ansible_user: { get_input: username }\n                    ansible_ssh_private_key_file: { get_input: private_key_path }\n                    ansible_become: true\n                    ansible_ssh_common_args: '-o StrictHostKeyChecking=no'\n```\n\nPassing `run_data` at runtime:\n\n```yaml\n  component:\n    type: cloudify.nodes.Root\n    interfaces:\n      cloudify.interfaces.lifecycle:\n        create:\n          implementation: ansible.cloudify_ansible.tasks.run\n          inputs:\n            site_yaml_path: resources/my_ansible_playbook/site.yaml\n            sources:\n              foo_group:\n                hosts:\n                  foo_host:\n                    ansible_host: { get_input: ip }\n                    ansible_user: { get_input: username }\n                    ansible_ssh_private_key_file: { get_input: private_key_path }\n                    ansible_become: true\n                    ansible_ssh_common_args: '-o StrictHostKeyChecking=no'\n            run_data:\n              foo: bar\n```\n\n# Examples\nFor official blueprint examples using this Cloudify plugin, please see [Cloudify Community Blueprints Examples](https://github.com/cloudify-community/blueprint-examples/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudify-cosmo%2Fcloudify-ansible-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudify-cosmo%2Fcloudify-ansible-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudify-cosmo%2Fcloudify-ansible-plugin/lists"}