{"id":30729286,"url":"https://github.com/woostju/ansible-client","last_synced_at":"2025-09-03T15:05:26.837Z","repository":{"id":52524233,"uuid":"259625493","full_name":"woostju/ansible-client","owner":"woostju","description":"A java client connect to Ansible server through ssh, and run Ansible command","archived":false,"fork":false,"pushed_at":"2024-10-03T17:58:17.000Z","size":68,"stargazers_count":25,"open_issues_count":2,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-03T15:02:59.684Z","etag":null,"topics":["ansible","java","ssh"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/woostju.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-28T12:04:56.000Z","updated_at":"2024-06-27T18:43:53.000Z","dependencies_parsed_at":"2025-09-03T15:03:01.698Z","dependency_job_id":null,"html_url":"https://github.com/woostju/ansible-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/woostju/ansible-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woostju%2Fansible-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woostju%2Fansible-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woostju%2Fansible-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woostju%2Fansible-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woostju","download_url":"https://codeload.github.com/woostju/ansible-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woostju%2Fansible-client/sbom","scorecard":{"id":1236908,"data":{"date":"2025-07-21","repo":{"name":"github.com/woostju/ansible-client","commit":"1042cc53e812048d5ead0f40ffefc560c6eb6acf"},"scorecard":{"version":"v5.2.1-24-gc29a04d4","commit":"c29a04d46d1570393e94662bc34e9906398e1bfa"},"score":1.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.0.0 not signed: https://api.github.com/repos/woostju/ansible-client/releases/26302746","Warn: release artifact 1.0.0 does not have provenance: https://api.github.com/repos/woostju/ansible-client/releases/26302746"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"90 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-vmfg-rjjm-rjrj","Warn: Project is vulnerable to: GHSA-vmq6-5m68-f53m","Warn: Project is vulnerable to: GHSA-668q-qrv7-99fm","Warn: Project is vulnerable to: GHSA-6v67-2wr5-gvf4","Warn: Project is vulnerable to: GHSA-pr98-23f8-jwxv","Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-288c-cq4h-88gq","Warn: Project is vulnerable to: GHSA-4gq5-ch57-c2mg","Warn: Project is vulnerable to: GHSA-4w82-r329-3q67","Warn: Project is vulnerable to: GHSA-57j2-w4cx-62h2","Warn: Project is vulnerable to: GHSA-5949-rw7g-wx7w","Warn: Project is vulnerable to: GHSA-5r5r-6hpj-8gg9","Warn: Project is vulnerable to: GHSA-5ww9-j83m-q7qx","Warn: Project is vulnerable to: GHSA-645p-88qh-w398","Warn: Project is vulnerable to: GHSA-6fpp-rgj9-8rwc","Warn: Project is vulnerable to: GHSA-6wqp-v4v6-c87c","Warn: Project is vulnerable to: GHSA-85cw-hj65-qqv9","Warn: Project is vulnerable to: GHSA-89qr-369f-5m5x","Warn: Project is vulnerable to: GHSA-8c4j-34r4-xr8g","Warn: Project is vulnerable to: GHSA-8w26-6f25-cm9x","Warn: Project is vulnerable to: GHSA-9gph-22xh-8x98","Warn: Project is vulnerable to: GHSA-9m6f-7xcq-8vf8","Warn: Project is vulnerable to: GHSA-9mxf-g3x6-wv74","Warn: Project is vulnerable to: GHSA-c8hm-7hpq-7jhg","Warn: Project is vulnerable to: GHSA-cf6r-3wgc-h863","Warn: Project is vulnerable to: GHSA-cggj-fvv3-cqwv","Warn: Project is vulnerable to: GHSA-cjjf-94ff-43w7","Warn: Project is vulnerable to: GHSA-cmfg-87vq-g5g4","Warn: Project is vulnerable to: GHSA-cvm9-fjm9-3572","Warn: Project is vulnerable to: GHSA-f3j5-rmmp-3fc5","Warn: Project is vulnerable to: GHSA-f9hv-mg5h-xcw9","Warn: Project is vulnerable to: GHSA-f9xh-2qgp-cq57","Warn: Project is vulnerable to: GHSA-fmmc-742q-jg75","Warn: Project is vulnerable to: GHSA-fqwf-pjwf-7vqv","Warn: Project is vulnerable to: GHSA-gjmw-vf9h-g25v","Warn: Project is vulnerable to: GHSA-gwp4-hfv6-p7hw","Warn: Project is vulnerable to: GHSA-gww7-p5w4-wrfv","Warn: Project is vulnerable to: GHSA-h3cw-g4mq-c5x2","Warn: Project is vulnerable to: GHSA-h592-38cm-4ggp","Warn: Project is vulnerable to: GHSA-h822-r4r5-v8jg","Warn: Project is vulnerable to: GHSA-jjjh-jjxp-wpff","Warn: Project is vulnerable to: GHSA-m6x4-97wx-4q27","Warn: Project is vulnerable to: GHSA-mph4-vhrx-mv67","Warn: Project is vulnerable to: GHSA-mx7p-6679-8g3q","Warn: Project is vulnerable to: GHSA-mx9v-gmh4-mgqw","Warn: Project is vulnerable to: GHSA-p43x-xfjf-5jhr","Warn: Project is vulnerable to: GHSA-q93h-jc49-78gg","Warn: Project is vulnerable to: GHSA-qjw2-hr98-qgfh","Warn: Project is vulnerable to: GHSA-qr7j-h6gg-jmgc","Warn: Project is vulnerable to: GHSA-r3gr-cxrf-hg25","Warn: Project is vulnerable to: GHSA-r695-7vr9-jgc2","Warn: Project is vulnerable to: GHSA-rfx6-vp9g-rh7v","Warn: Project is vulnerable to: GHSA-rgv9-q543-rqg4","Warn: Project is vulnerable to: GHSA-rpr3-cw39-3pxh","Warn: Project is vulnerable to: GHSA-v585-23hc-c647","Warn: Project is vulnerable to: GHSA-vfqx-33qm-g869","Warn: Project is vulnerable to: GHSA-w3f4-3q6j-rh82","Warn: Project is vulnerable to: GHSA-wh8g-3j2c-rqj5","Warn: Project is vulnerable to: GHSA-x2w5-5m2g-7h5m","Warn: Project is vulnerable to: GHSA-pfh2-hfmq-phg5","Warn: Project is vulnerable to: GHSA-78wr-2p64-hpwj","Warn: Project is vulnerable to: GHSA-gwrp-pvrq-jmwv","Warn: Project is vulnerable to: GHSA-269g-pwp5-87pp","Warn: Project is vulnerable to: GHSA-p53j-g8pw-4w5f","Warn: Project is vulnerable to: GHSA-493p-pfq6-5258","Warn: Project is vulnerable to: GHSA-v528-7hrm-frqp","Warn: Project is vulnerable to: GHSA-6xx3-rg99-gc3p","Warn: Project is vulnerable to: GHSA-72m5-fvvv-55m6","Warn: Project is vulnerable to: GHSA-8xfc-gm6g-vgpv","Warn: Project is vulnerable to: GHSA-hr8g-6v94-x4m9","Warn: Project is vulnerable to: GHSA-v435-xc8x-wvr9","Warn: Project is vulnerable to: GHSA-wjxj-5m7g-mg7q","Warn: Project is vulnerable to: GHSA-cm59-pr5q-cw85","Warn: Project is vulnerable to: GHSA-rc42-6c7j-7h5r","Warn: Project is vulnerable to: GHSA-xf96-w227-r7c4","Warn: Project is vulnerable to: GHSA-36p3-wjmg-h94x","Warn: Project is vulnerable to: GHSA-hh26-6xwr-ggv7","Warn: Project is vulnerable to: GHSA-4gc7-5j7h-4qph","Warn: Project is vulnerable to: GHSA-4wp7-92pw-q264","Warn: Project is vulnerable to: GHSA-g5mm-vmx4-3rg7","Warn: Project is vulnerable to: GHSA-4487-x383-qpph","Warn: Project is vulnerable to: GHSA-f26x-pr96-vw86","Warn: Project is vulnerable to: GHSA-ffvq-7w96-97p7","Warn: Project is vulnerable to: GHSA-g8hw-794c-4j9g","Warn: Project is vulnerable to: GHSA-rcpf-vj53-7h2m","Warn: Project is vulnerable to: GHSA-558x-2xjg-6232","Warn: Project is vulnerable to: GHSA-564r-hj7v-mcr5","Warn: Project is vulnerable to: GHSA-9cmq-m9j5-mvww","Warn: Project is vulnerable to: GHSA-wxqc-pxw9-g2p8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c29a04d46d1570393e94662bc34e9906398e1bfa/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-09-03T15:03:04.788Z","repository_id":52524233,"created_at":"2025-09-03T15:03:04.791Z","updated_at":"2025-09-03T15:03:04.791Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273460603,"owners_count":25109763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ansible","java","ssh"],"created_at":"2025-09-03T15:02:58.360Z","updated_at":"2025-09-03T15:05:26.826Z","avatar_url":"https://github.com/woostju.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible-client\nA java implemented client connect to Ansible servers through ssh, and run Ansible command.\n\n## usage\n\nansible-client is available from **Maven Central**\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.woostju\u003c/groupId\u003e\n  \u003cartifactId\u003eansible-client\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0-RELEASE\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Who is this for?\n\nAnyone who want to execute commands on your Ansible server in java code, instead of logging into server and execute manually.\n\nWith this, you can build an automation tool yourself working with Ansible in java.\n\n### How do I use this?\n\nUse it in your class:\n\n```java\n\nimport com.github.woostju.ssh.SshClientConfig;\nimport com.github.woostju.ansible.AnsibleClient;\nimport com.github.woostju.ansible.ReturnValue;\nimport com.github.woostju.ansible.ReturnValue.Result;\n\n//---------------------------------------\n\npublic void execute() {\n\tAnsibleClient client = new AnsibleClient(new SshClientConfig(\"hostIp\", \"sshPort\", \"username\", \"password\", null));\n\tMap\u003cString, ReturnValue\u003e result =client.execute(new PingCommand(Lists.newArrayList(host_inner_ip)), 1000);\n}\n```\n\nIt is recommended to use AnsibleClient with [SshClientPool](https://github.com/woostju/ssh-client-pool), so that ansibleClient borrows sshClient from the pool to execute command, to avoid create ssh connection each time:\n\n```java\nimport com.github.woostju.ssh.SshClientConfig;\nimport com.github.woostju.ansible.AnsibleClient;\nimport com.github.woostju.ansible.ReturnValue;\nimport com.github.woostju.ansible.ReturnValue.Result;\nimport com.github.woostju.ssh.pool.SshClientsPool;\n\n//---------------------------------------\n\n// inject the auto-configured one\n@Autowired\nSshClientsPool pool;\n\n//---------------------------------------\npublic void execute() {\n\tAnsibleClient client = new AnsibleClient(new SshClientConfig(\"hostIp\", \"sshPort\", \"username\", \"password\", null), pool);\n\tMap\u003cString, ReturnValue\u003e result =client.execute(new PingCommand(Lists.newArrayList(host_inner_ip)), 1000);\n}\n\n```\n\nTo get more usage, please refer to the unit test code and java docs.\n\n### How does it work?\n\nAnsibleClient connects to Ansible server with ssh, and sends an Ansible adhoc command to server, and parses the output into ReturnValue.\n\n### How many Ansible module does ansible-client support?\n\nUntil this release, ansible-client supports modules below:\n\n| module name | module class | description | official link |\n| :----:| :----: | :----: | :----: |\n| command |  CmdCommand | The command will be executed on hosts | [link](https://docs.ansible.com/ansible/latest/modules/command_module.html) |\n| copy | CopyCommand | Copies a file from the local or remote machine to a location on the remote machine | [link](https://docs.ansible.com/ansible/latest/modules/copy_module.html) | \n| file | FileCommand | Manage files and file properties | [link](https://docs.ansible.com/ansible/latest/modules/file_module.html) | \n| git | GitCommand | Deploy software (or files) from git checkouts | [link](https://docs.ansible.com/ansible/latest/modules/git_module.html) | \n| ping | PingCommand | Try to connect to host, verify a usable python and return pong on success |[link](https://docs.ansible.com/ansible/latest/modules/ping_module.html) | \n| playbook | PlaybookCommand |  Run playbook with ansible-playbook executable | [link](https://docs.ansible.com/ansible/latest/user_guide/playbooks.html) |\n| script | ScriptCommand | Runs a local script on a remote node after transferring it | [link](https://docs.ansible.com/ansible/latest/modules/script_module.html) | \n\nSince Ansible itself has dozens of modules, you can also define your custom command class to work with AnsibleClient.\n  \n```java\nimport java.util.List;\n\nimport com.github.woostju.ansible.Module;\n\n/**\n* Add or remove MSSQL databases from a remote host.\n*/\npublic class Mssql_dbCommand extends Command{\n\n\t/**\n\t * @param hosts target hosts\n\t */\n\tpublic Mssql_dbCommand(List\u003cString\u003e hosts, String login_host, String login_password, int login_port, String login_user, String name, String target, String state) {\n\t\tthis(hosts, Lists.newArrayList(\"login_host=\"+login_host,\n\t\t\"login_password=\"+login_password,\n\t\t\"login_port=\"+login_port,\n\t\t\"login_user=\"+login_user,\n\t\t\"name=\"+name,\n\t\t\"target=\"+target,\n\t\t\"state=\"+state), null);\n\t}\n\t\n\tpublic Mssql_dbCommand(List\u003cString\u003e hosts, List\u003cString\u003e moduleArgs, List\u003cString\u003e options) {\n\t\tsuper(hosts, Module.ping.toString(), moduleArgs, options);\n\t}\n}\n\n```\n## License\n\nThis code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0).\n\n\n## Additional Resources\n\n* [SshClientPool](https://github.com/woostju/ssh-client-pool) a java implementation of ssh clients object pool with sshj, apache common pool2, expectIt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoostju%2Fansible-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoostju%2Fansible-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoostju%2Fansible-client/lists"}