QT-DevOps / DevOpsIssues

This Repo will be used to demonstrate the Skills & Questions in DevOps
Apache License 2.0
27 stars 130 forks source link

Chef-kitchen converge issue #950

Closed satyagopals closed 3 years ago

satyagopals commented 3 years ago

Sir,

i have created a kitchenawsdemo cookbook as explained by you in class. this is for ubuntu and redhat, default.rb, utils.rb and kitchen.yaml files are created. in aws ubuntu and redhat machine also created but unable to login from git bash manually. kitchen converge is failing. Waiting for SSH service on ec2-................. is displaying on screen

please find the attached docs

kitchenconvergeissue.docx

i tried to contact lab assistant Jagadeesh thru WP, sent error image files also , called him but no response.

can you look into this issue and let me know.

Thanks Satya

srmanikanta commented 3 years ago

follow this approach and do not copy paste the below configuration, please change according to your aws region and default vpc and one more thing is please check the ami is working manually or not (especially centos). This the kitchen.yml file for both ubuntu and centos

driver:
  name: ec2
  aws_ssh_key_id: elasticsearch
  region: us-east-2
  availability_zone: us-east-2a
  subnet_id: subnet-6602050e
  instance_type: t2.micro
  image_id: ami-0d5d9d301c853a04a
  security_group_ids: ["sg-0eeb8a9322eb69c42"]

## The forwarded_port port feature lets you connect to ports on the VM guest via
## localhost on the host.
## see also: https://www.vagrantup.com/docs/networking/forwarded_ports.html

#  network:
#    - ["forwarded_port", {guest: 80, host: 8080}]

provisioner:
  name: chef_zero
  # You may wish to disable always updating cookbooks in CI or other testing environments.
  # For example:
  #   always_update_cookbooks: <%= !ENV['CI'] %>
  always_update_cookbooks: true

  ## product_name and product_version specifies a specific Chef product and version to install.
  ## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
  #  product_name: chef
  #  product_version: 15

transport: 
  ssh_key: ./elasticsearch.pem
  connection_timeout: 10
  connection_retries: 5
  username: ubuntu 

verifier:
  name: inspec

platforms:
  - name: ubuntu-18.04
  - name: centos-7
    driver:
      name: ec2
      aws_ssh_key_id: elasticsearch
      region: us-east-2
      availability_zone: us-east-2a
      subnet_id: subnet-6602050e
      instance_type: t2.micro
      image_id: ami-0f2b4fc905b0bd1f1
      security_group_ids: ["sg-0eeb8a9322eb69c42"]
    transport:
      username: centos
      ssh_key: ./elasticsearch.pem
      connection_timeout: 10
      connection_retries: 5
    provisioner:
      name: chef_zero
    verifier:
      name: inspec

suites:
  - name: default
    run_list:
      - recipe[apachewithphp::default]
    verifier:
      inspec_tests:
        - test/integration/default
    attributes:

this configuration working and please change the values related to you aws.

satyagopals commented 3 years ago

thanks Manikantha. it's working fine now hence closing this ticket.