Skip to content

Victor Ricardo

infraascode

  • HOME
  • CONTATO
  • SOBRE
  • CATEGORIAS
    • Ansible
    • AWS
    • Blog
    • CentOS/RHEL
    • Docker
    • Kubernetes
    • OTOBO
    • OTRS
    • Terraform
    • TOPIC Out-of-the-box
    • Victor
    • Zabbix

AWS SERIES: DAY … FOUR: (templating) CUSTOM IMAGE, (pre-installing) APPS-SOFTWARES, e (seeking) SYSTEM-LOGS

AWS
Victor Ricardo in 14 jan 2022

Quarto dia de trabalho, quarta máquina a ser provisionada, e contando … Mas, excepcionalmente hoje de um jeito diferente. Ao invés de fazer todo o processo manual, iremos delegar uma parte importante à automação. Pacotes, repositórios, programas e até mesmo configurações podem acompanhar a instância desde o primeiro momento, bastando apenas que você instrua da maneira correta. Existem duas formas para isso: (a) via AWS Marketplace ou (b) via campo User Data

>_ CUSTOM IMAGE: AWS MARKETPLACE

O ponto de partida é a tela chamada Executar instâncias Dê um clique e procure por AWS Marketplace no lado esquerdo. ( Parênteses … Se antes de chegar nessa etapa, e caso esteja fazendo logon novamente na console, talvez você seja questionado se deseja mudar, ou não, para a nova tela inicial de gerenciamento. Como foi o meu caso, disse sim, e portanto ela se parecerá mais ou menos com isso daqui … Fecha parênteses! )

Figura 01. SIM ou NÃO? nova página inicial
Figura 02. new dashboard

Voltando ao que realmente interessa … Observe que além dos destaques, marcados na página como popular software, logo abaixo há uma infinidade de categorias para escolher e navegar.

Figura 03. programas que estão em alta
Figura 04. categorias
Figura 05. softwares para backup

Uma vez selecionado(a), continue em frente e execute normalmente os demais passos para criar uma instância EC2 😉 Mas, muito cuidado! Alguns podem ser pagos, e sendo assim serão cobrados mensalmente, anualmente ou única parcela 😨

>_ CUSTOM IMAGE: USER DATA

Retorne ao marco zero: Executar instâncias e escolha uma imagem. Aqui vamos utilizar a da própria AWS: o Amazon Linux. Em seguida, defina o tipo de máquina: T2.MICRO, para finalmente informar os detalhes acerca da mesma … Número de instâncias: 1 (possível lançar até 5 simultaneamente); Opções de VPC (rede, sub-rede, ip público): todas padrão-default; Habilitar proteção contra encerramento: sim (marque!); Detalhes avançados: dados do usuário (userdata)

Figura 06. detalhes da instância
Figura 07. dados do usuário (userdata)

O último detalhe mencionado trata-se de um campo aonde é possível escrever linha por linha um script automatizado para a máquina-alvo. Este poderia ser um powershell (windows) ou shellscript (unix), por exemplo. Então agora vamos ao nosso:

#!/bin/bash

##### install needed packages for ansible ...

yum update -y
amazon-linux-extras install -y
amazon-linux-extras install -y ansible2
yum install -y git

Salve o conteúdo avançando para a próxima tela, 8 GB de armazenamento, nenhuma TAG, grupo de segurança: acesso, review, launch, selecione a chave SSH, e pronto! Só aguardar …

Figura 08. status … carregando
Figura 09.

E para validar? (a) Reparem que a sugestão de SUDO YUM UPDATE nessa nova instância não apareceu em tela, tendo em vista que o mesmo foi instruído automaticamente. (b) Tanto o ANSIBLE quanto o PYTHON já se encontram disponíveis, bastando listar e usar.

Figura 10. ansible –version

>_ SYSTEM LOG: ACCESS RULES, ETC …

Selecionar instância > Ações > Monitorar e solucionar problemas > Obter log do sistema

Figura 11. obter log do sistema

>_ REFERÊNCIAS:

https://www.capsunlock.net/2012/05/using-ansible-pull-and-user-data-to-setup-ec2-or-openstack-servers.html

https://stackoverflow.com/questions/34497447/autoscaling-with-aws-instances-using-ansible-pull-with-master-and-slave-configur

Compartilhe isso:

  • Facebook
  • 18+

Curtir isso:

Curtir Carregando...

Relacionado

Short URL https://vicrlda.com.br/?p=3451
Tagsamazonlinuxappsautomatesaws.amazon.comcloudcomputingcustomec2imagemarketplacepkgrhel-likeshellscriptsoftwarest2.microtemplateuserdatavirtualmachine

Deixe uma respostaCancelar resposta

Este site utiliza o Akismet para reduzir spam. Saiba como seus dados em comentários são processados.

← Previous Post Next Post →

Search

Recent Posts

  • OTOBO SERIES: TEORIA … Um Fork do OTRS
    OTOBO SERIES: TEORIA … Um Fork do OTRS
     28 de setembro de 2023 Nenhum comentário
  • KUBERNETES SERIES: LAB … O primeiro POD
    KUBERNETES SERIES: LAB … O primeiro POD
     11 de julho de 2023 Nenhum comentário
  • KUBERNETES SERIES: LAB … Downloading on Linux: Minikube
    KUBERNETES SERIES: LAB … Downloading on Linux: Minikube
     6 de abril de 2023 Nenhum comentário
  • KUBERNETES SERIES: Clusters, História e Terminologia
    KUBERNETES SERIES: Clusters, História e Terminologia
     20 de março de 2023 1 comentário
  • DOCKER SERIES: Final … COMPOSE: Multicontainers
    DOCKER SERIES: Final … COMPOSE: Multicontainers
     2 de março de 2023 Nenhum comentário

Categories

  • Ansible
  • AWS
  • Docker
  • Terraform
  • OTRS
  • Victor
  • Zabbix
  • Kubernetes
  • CentOS/RHEL
  • Blog
  • OTOBO
  • TOPIC Out-of-the-box

© 2020-2025 Victor Ricardo

Powered by WordPress Whiteboard Theme

↑
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Sempre ativado
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDuraçãoDescrição
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SALVAR E ACEITAR
Desenvolvido por CookieYes Logo
 

Carregando comentários...
 

    %d