{"id":15663133,"url":"https://github.com/cytopia/ansible-modules","last_synced_at":"2025-05-06T05:44:45.093Z","repository":{"id":147859111,"uuid":"99048549","full_name":"cytopia/ansible-modules","owner":"cytopia","description":"Custom ansible modules","archived":false,"fork":false,"pushed_at":"2017-08-29T07:30:28.000Z","size":39,"stargazers_count":19,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T01:22:03.247Z","etag":null,"topics":["ansible","ansible-modules","aws","cloudformation","orchestration"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cytopia.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}},"created_at":"2017-08-01T22:34:26.000Z","updated_at":"2025-01-22T13:11:52.000Z","dependencies_parsed_at":"2023-06-06T09:15:33.952Z","dependency_job_id":null,"html_url":"https://github.com/cytopia/ansible-modules","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytopia%2Fansible-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytopia%2Fansible-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytopia%2Fansible-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytopia%2Fansible-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cytopia","download_url":"https://codeload.github.com/cytopia/ansible-modules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252631223,"owners_count":21779417,"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","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","ansible-modules","aws","cloudformation","orchestration"],"created_at":"2024-10-03T13:35:35.552Z","updated_at":"2025-05-06T05:44:45.045Z","avatar_url":"https://github.com/cytopia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Modules\n\nSome custom ansible modules not yet submitted or accepted by [Ansible](https://github.com/ansible/ansible).\n\n## Usage\n\n#### diff\n\nAn Ansible module to do generic diffs against strings, files and command outputs.\n\n**Task Examples**\n\n```yml\n# Diff compare two strings\n- diff:\n    source: \"foo\"\n    target: \"bar\"\n    source_type: string\n    target_type: string\n# Diff compare variable against template file (as strings)\n- diff:\n    source: \"{{ lookup('template', tpl.yml.j2) }}\"\n    target: \"{{ my_var }}\"\n    source_type: string\n    target_type: string\n# Diff compare string against command output\n- diff:\n    source: \"/bin/bash\"\n    target: \"which bash\"\n    source_type: string\n    target_type: command\n# Diff compare file against command output\n- diff:\n    source: \"/etc/hostname\"\n    target: \"hostname\"\n    source_type: file\n    target_type: command\n```\n\n#### cloudformation_diff\n\nAn Ansible module that will show the differences that would occur in case you actually run [cloudformation_module](http://docs.ansible.com/ansible/latest/cloudformation_module.html). Changes to be shown include:\n\n1. Stack template changes\n2. Stack parameter changes\n3. Stack tag changes\n\nChanges that can be omitted by the module:\n\n1. Stack template description\n2. Stack parameters that use `NoEcho: true`\n\nThe diff output can be in `json` or `yaml` depending on your preferred choice to view the diff.\n\n**Options**\n\n| Parameter | Required | Default | Choices | Comments |\n|-----------|----------|---------|---------|----------|\n| aws_access_key | no  |         |         | AWS access key. If not set then the value of the AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY or EC2_ACCESS_KEY environment variable is used. |\n| aws_secret_key | no  |         |         | AWS secret key. If not set then the value of the AWS_SECRET_ACCESS_KEY, AWS_SECRET_KEY, or EC2_SECRET_KEY environment variable is used. |\n| ec2_url   | no       |         |         | Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used. |\n| profile   | no       |         |         | Uses a boto profile. Only works with boto \u003e= 2.24.0. |\n| region    | no       |         |         | The AWS region to use. If not specified then the value of the AWS_REGION or EC2_REGION environment variable, if any, is used. See http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region |\n| security_token | no  |         |         | AWS STS security token. If not set then the value of the AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN environment variable is used. |\n| stack_name     | yes |         |         | Name of the cloudformation stack |\n| template       | yes |         |         | Path to local cloudformation template file (yaml or json) |\n| template_parameters | no |     |         | Dict of variable template parameters to add to the stack. |\n| template_tags  | no  |         |         | Dict of tags to asign to the stack. |\n| ignore_template_desc | no | no | `yes` or `no` | In template diff mode, ignore the template description |\n| ignore_hidden_params | no | no | `yes` or `no` | In parameter diff mode, ignore any template parameters with 'NoEcho: true' |\n| ignore_final_newline | no | no | `yes` or `no` | In all diff modes, remove any trailing newline (\\n or \\r) |\n| output_format  | no  | json | `json` or `yaml` | Specify in what format to view the diff output ('json' or 'yaml') |\n| output_choice  | no  | template | `template`, `parameters` or `tags` | Specify what to diff ('template', 'parameters' or 'tags') |\n| validate_certs | no  | yes     | `yes` or `no` | When set to \"no\", SSL certificates will not be validated for boto versions \u003e= 2.6.0. |\n\n**How to run**\n\n```shell\n# Ansible dry-run to see what would change\n$ ansible-playbook cfn-playbook.yml --diff --check\n```\n\n**Task Examples**\n\n```yaml\n# By using the following:\n#   when: ansible_check_mode\n#   check_mode: no\n# you can make sure to only run the cloudformation_diff in ansible --check mode\n# to view the diff, you must also specify --diff\n\n# Get changes for the template only and ignore\n# the template description.\n# Local stack file can be json or yaml.\n# Diff is shown in yaml.\n- name: \"diff Cloudformation template: {{ cfn_stack_name }}\"\n  cloudformation_diff:\n    region: \"us-east-1\"\n    stack_name: \"{{ cfn_stack_name }}\"\n    template: \"{{ cfn_template }}\"\n    template_parameters: \"{{ cfn_template_parameters }}\"\n    template_tags: \"{{ cfn_tags|default(omit) }}\"\n    ignore_template_desc: yes\n    output_choice: template\n    output_format: yaml\n  when: ansible_check_mode\n  check_mode: no\n\n# Get changes for the parameters and ignore any\n# NoEcho: true parameters.\n# Local stack file can be json or yaml.\n# Diff is shown in json.\n- name: \"diff Cloudformation template params: {{ cfn_stack_name }}\"\n  cloudformation_diff:\n    region: \"us-east-1\"\n    stack_name: \"{{ cfn_stack_name }}\"\n    template: \"{{ cfn_template }}\"\n    template_parameters: \"{{ cfn_template_parameters }}\"\n    template_tags: \"{{ cfn_tags|default(omit) }}\"\n    ignore_hidden_params: yes\n    output_choice: parameter\n    output_format: json\n  when: ansible_check_mode\n  check_mode: no\n\n# Get changes for the tags.\n# Local stack file can be json or yaml.\n# Diff is shown in json.\n- name: \"diff Cloudformation template tags: {{ cfn_stack_name }}\"\n  cloudformation_diff:\n    region: \"us-east-1\"\n    stack_name: \"{{ cfn_stack_name }}\"\n    template: \"{{ cfn_template }}\"\n    template_parameters: \"{{ cfn_template_parameters }}\"\n    template_tags: \"{{ cfn_tags|default(omit) }}\"\n    output_choice: tags\n    output_format: json\n  when: ansible_check_mode\n  check_mode: no\n```\n\n\n## Integration\n\n\u003e Assuming you are in the root folder of your ansible project.\n\nSpecify a module path in your ansible configuration file.\n\n```shell\n$ vim ansible.cfg\n```\n```ini\n[defaults]\n...\nlibrary = ./library\n...\n```\n\nCreate the directory and copy the python modules into that directory\n\n```shell\n$ mkdir library\n$ cp path/to/module library\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcytopia%2Fansible-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcytopia%2Fansible-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcytopia%2Fansible-modules/lists"}