GithubHelp home page GithubHelp logo

ansible-role-amazon-ssm's People

Contributors

btsteve avatar ddrugeon avatar dependabot[bot] avatar diodonfrost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-role-amazon-ssm's Issues

Role fails on Register on-premise host with Ubuntu 20.04 LTS and snap

SUMMARY

Role fails on Register on-premise host with SSM on Ubuntu 20.04 LTS and snap

STEPS TO REPRODUCE
        allow_sudo: true
        activation_id: "xxxxxxxx"
        activation_code: "xxxxxxxx"
        aws_region: "xx-xxxx-x"

EXPECTED RESULTS
TASK [diodonfrost.amazon_ssm : Linux/Darwin | Register on-premise host] ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
ok: [xx.xx.xx.xx]
ACTUAL RESULTS
TASK [diodonfrost.amazon_ssm : Linux/Darwin | Register on-premise host] **************************************************************************************************************
fatal: [xx.xx.xx.xx]: FAILED! => {"changed": true, "cmd": ["/snap/amazon-ssm-agent/current/amazon-ssm-agent", "-register", "-code", "ilkIdTbal9WQXjpjjB08", "-id", "xxxxxxxx", "-region", "xx-xxxx-x"], "delta": "0:00:00.784650", "end": "2023-09-15 22:37:24.307265", "msg": "non-zero return code", "rc": 1, "start": "2023-09-15 22:37:23.522615", "stderr": "", "stderr_lines": [], "stdout": "Error occurred fetching the seelog config file path:  open /etc/amazon/ssm/seelog.xml: no such file or directory\nInitializing new seelog logger\nNew Seelog Logger Creation Complete\n2023-09-15 22:37:23 WARN Error adding the directory '/etc/amazon/ssm' to watcher: no such file or directory\n2023-09-15 22:37:24 WARN Could not read InstanceFingerprint file: InstanceFingerprint does not exist\n2023-09-15 22:37:24 INFO No initial fingerprint detected, generating fingerprint file...\n2023-09-15 22:37:24 ERROR Registration failed due to error registering the instance with AWS SSM. InvalidActivation: ", "stdout_lines": ["Error occurred fetching the seelog config file path:  open /etc/amazon/ssm/seelog.xml: no such file or directory", "Initializing new seelog logger", "New Seelog Logger Creation Complete", "2023-09-15 22:37:23 WARN Error adding the directory '/etc/amazon/ssm' to watcher: no such file or directory", "2023-09-15 22:37:24 WARN Could not read InstanceFingerprint file: InstanceFingerprint does not exist", "2023-09-15 22:37:24 INFO No initial fingerprint detected, generating fingerprint file...", "2023-09-15 22:37:24 ERROR Registration failed due to error registering the instance with AWS SSM. InvalidActivation: "]}
ENVIRONMENT

ansible [core 2.12.10]
Ubuntu 20.04.6 LTS

Not able to register an Ubuntu host where ssm agent was installed using SNAP.

SUMMARY

Not able to register an Ubuntu host where ssm agent was installed using SNAP.

STEPS TO REPRODUCE

Execute the role over an Ubuntu 20.04 host with activation_id, activation_code and aws_region values.

- hosts: all
  become: yes
  roles:
  - role: diodonfrost.amazon_ssm
    vars:
      aws_region: "{{ region }}"
      activation_id: "{{ id }}"
      activation_code: "{{ code }}"
EXPECTED RESULTS

Ubuntu host is registered in AWS SSM using the ssm_agent_bin as /snap/amazon-ssm-agent/current/amazon-ssm-agent or snap run amazon-ssm-agent

ACTUAL RESULTS

It executes amazon-ssm-agent for registering the instance but as it was installed using Snap, it is not able to find the file.

TASK [diodonfrost.amazon_ssm : Linux | Register on-premise host] ****************************************************************************************************************************************************************************************************************
fatal: [<ip>]: FAILED! => {"changed": false, "cmd": "amazon-ssm-agent -register -code <code> -id <id> -region <region>", "msg": "[Errno 2] No such file or directory: b'amazon-ssm-agent'", "rc": 2}

recently added darwin support appears to break ansible-playbook on linux boxes

SUMMARY

The reference to the osx specific community.general.launchd in the handlers appears to break ansible-playbook.

STEPS TO REPRODUCE

Using a playbook that runs with the new role installed.

- name: Initialize common AWS configuration
  hosts: all
  become: true
  roles:
    - diodonfrost.amazon_ssm
EXPECTED RESULTS

Playbook parses and starts running successfully.

ACTUAL RESULTS
Executing Ansible: ansible-playbook -e packer_build_name="elasticsearch-6_x-x64" -e packer_builder_type=amazon-ebs --ssh-extra-args '-o IdentitiesOnly=yes' -v
No config file found; using defaults
ERROR! couldn't resolve module/action 'community.general.launchd'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/builds/gas/trustkeeper-aws/ami/elasticsearch-6/roles/diodonfrost.amazon_ssm/handlers/main.yml': line 13, column 3, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:

- name: Darwin | Restart amazon ssm agent
  ^ here
ENVIRONMENT

alpine linux

ansible 2.9.16
  config file = None
  configured module search path = ['/home/packer/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.8.5 (default, Jul 20 2020, 23:11:29) [GCC 9.3.0]

Does not work with Ansible 2.10+

SUMMARY

Ansible 2.10 changed the namespaces of builtin modules.

STEPS TO REPRODUCE

Run a basic playbook calling this role using Ansible 2.10+.

EXPECTED RESULTS

Not error out.

ACTUAL RESULTS
ERROR! couldn't resolve module/action 'win_service'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/Users/xxx/ansible/playbooks/roles.galaxy/diodonfrost.amazon_ssm/handlers/main.yml': line 18, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Windows | Restart amazon ssm agent
  ^ here
ENVIRONMENT
  • MacOS Big Sur
  • Ansible version 2.10.0
  • Python version 3.8.7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.