AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / 问题

All perguntas(server)

Martin Hope
Dmitriano
Asked: 2025-01-30 03:36:20 +0800 CST

Não é possível instalar build-essential dentro de um contêiner Docker

  • 4

Recebo o seguinte erro:

3.033 Err:32 http://security.ubuntu.com/ubuntu noble-updates/main amd64 linux-libc-dev amd64 6.8.0-51.52
3.034   404  Not Found [IP: 91.189.91.82 80]

ao tentar executar o seguinte comando dentro de um contêiner Docker:

FROM ubuntu:24.04

RUN apt update
RUN apt upgrade

RUN apt -y install build-essential

É um problema relacionado ao DNS?

/etc/resolv.confno contêiner Docker:

# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.

nameserver 172.236.0.51
nameserver 172.236.0.54
nameserver 172.236.0.48
nameserver 172.236.0.46
nameserver 172.236.0.50
nameserver 172.236.0.47
nameserver 172.236.0.53
nameserver 172.236.0.52
nameserver 172.236.0.45
nameserver 172.236.0.49
search members.linode.com ip.linodeusercontent.com

# Based on host file: '/run/systemd/resolve/resolv.conf' (legacy)
# Overrides: []

é diferente da /etc/resolv.confminha máquina host (Ubuntu 24.04):

ll /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Jan 23 18:19 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
cat /etc/resolv.conf

nameserver 127.0.0.53
options edns0 trust-ad
search members.linode.com ip.linodeusercontent.com

mas corresponde /run/systemd/resolve/resolv.confna máquina host.

Não entendo por que tenho dois diferentes resonv.confna minha máquina host.

Também não está claro o suficiente se o DNS dentro do contêiner do Docker está configurado corretamente ou não.

EDITAR1

Rotas no contêiner Docker:

ip route show
default via 172.17.0.1 dev eth0
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.3

Rotas na máquina host:

ip route show
default via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
172.18.0.0/16 dev br-7c0ebcfd4e3a proto kernel scope link src 172.18.0.1
172.20.0.0/16 dev br-99d8bde8e488 proto kernel scope link src 172.20.0.1
172.236.0.45 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.46 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.47 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.48 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.49 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.50 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.51 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.52 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.53 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.54 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.29.0/24 dev eth0 proto kernel scope link src 172.236.29.157 metric 1024
172.236.29.1 dev eth0 proto dhcp scope link src 172.236.29.157 metric 1024

Do contêiner Docker:

ping 91.189.91.82
PING 91.189.91.82 (91.189.91.82) 56(84) bytes of data.
64 bytes from 91.189.91.82: icmp_seq=1 ttl=47 time=82.5 ms
64 bytes from 91.189.91.82: icmp_seq=2 ttl=47 time=82.6 ms

telnet security.ubuntu.com 80
Trying 91.189.91.81...
Connected to security.ubuntu.com.
Escape character is '^]'.
^]
telnet> quit
Connection closed.

EDITAR2

Do contêiner Docker:

root@4e534b3b6847:/# apt install --no-cache linux-libc-dev
E: Command line option --no-cache is not understood in combination with the other options
root@4e534b3b6847:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          49G   34G   15G  70% /
tmpfs            64M     0   64M   0% /dev
shm              64M     0   64M   0% /dev/shm
/dev/sda         49G   34G   15G  70% /etc/hosts
tmpfs           985M     0  985M   0% /proc/acpi
tmpfs           985M     0  985M   0% /proc/scsi
tmpfs           985M     0  985M   0% /sys/firmware

root@4e534b3b6847:/# apt clean
root@4e534b3b6847:/# apt install linux-libc-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
linux-libc-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,769 kB of archives.
After this operation, 7,508 kB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 linux-libc-dev amd64 6.8.0-51.52
Err:1 http://security.ubuntu.com/ubuntu noble-updates/main amd64 linux-libc-dev amd64 6.8.0-51.52
404  Not Found [IP: 185.125.190.82 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_6.8.0-51.52_amd64.deb  404  Not Found [IP: 185.125.190.82 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

EDITAR3

Na máquina host:

  $ apt-cache policy linux-libc-dev
  linux-libc-dev:
  Installed: 6.8.0-52.53
  Candidate: 6.8.0-52.53
  Version table:
  *** 6.8.0-52.53 500
        500 http://mirrors.linode.com/ubuntu noble-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
        100 /var/lib/dpkg/status
     6.8.0-31.31 500
        500 http://mirrors.linode.com/ubuntu noble/main amd64 Packages

No contêiner Docker:

  # apt-cache policy linux-libc-dev
  linux-libc-dev:
  Installed: (none)
  Candidate: 6.8.0-51.52
  Version table:
     6.8.0-51.52 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
     6.8.0-31.31 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
domain-name-system
  • 1 respostas
  • 110 Views
Martin Hope
Cory Glanton
Asked: 2025-01-30 02:29:16 +0800 CST

Problema com Entra/InTune MFA

  • 8

Estou trabalhando em um ambiente escolar muito pequeno. Eles estão em licenças M365 A3 e usando Entra junto com InTune para mdm.

Desabilitamos (pelo menos em teoria) todos os MFA para que todos os usuários (especialmente os alunos) possam simplesmente fazer login sem precisar usar o Authenticator.

O problema é que alguns alunos estão sendo solicitados a baixar o Authenticator pp quando fazemos login em "trabalho/escola". O prompt que estamos recebendo diz que nossa organização exige isso.

Desabilitei o MFA no Entra. O que posso estar perdendo?

entra-id
  • 1 respostas
  • 102 Views
Martin Hope
josh_SWR
Asked: 2025-01-29 22:16:00 +0800 CST

Problemas de conexão com impressoras compartilhadas do Windows Server 2022

  • 5

Preciso mapear uma impressora que está sendo compartilhada por um cliente Windows 11 em uma máquina Windows Server 2022. O servidor consegue ver o caminho UNC da impressora no File Explorer, mas tentar se conectar a ele não faz nada. Eu nem recebo nenhum tipo de erro ou aviso, ele simplesmente não faz nada. Ao reiniciar o spooler de impressão, ele mostrará um erro, o que significa que ele inicia a conexão em segundo plano, mas aparentemente ele apenas trava.

Não consigo entender por que não está funcionando. Outros clientes Windows 10/11 conseguem se conectar a ele sem problemas, só este Windows Server que não consegue.

Ambos estão na mesma LAN e o firewall do Windows está desabilitado, então não é um problema de rede.

Alguém sabe o que posso fazer para consertar isso?

windows
  • 1 respostas
  • 120 Views
Martin Hope
Sam
Asked: 2025-01-29 17:30:49 +0800 CST

Protegendo meu servidor NUT UPS - Prevenir acesso remoto não autenticado

  • 5

Tenho um servidor NUT em um RPi 2, que configurei. De outro cliente, posso conectar pela porta 3493 e monitorar o status do UPS. No entanto, meu problema é que posso inserir qualquer nome de usuário/senha, ou deixá-lo de fora completamente, e ainda conectar. Não quero isso. Não entendo o que está causando esse comportamento. Alguém tem alguma ideia sobre isso?

Como posso evitar login sem usuário/senha de clientes remotos?

Agora posso executar este comando sem autenticação de um cliente remoto:

upsc [email protected]

Ou upsd.users não deveria ser usado dessa maneira?

Meus arquivos de configuração são assim:

porca.conf

MODE=netserver

upsd.conf

LISTEN 0.0.0.0 3493

upsd.usuários

[admin]
    password = pass
    actions = SET
    actions = FSD
    instcmds = ALL

[local]
    password = pass
    upsmon master

[remote]
    password = pass
    upsmon slave

[monuser]
    password = pass
    upsmon slave

upsmon.conf

MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 30
DEADTIME 25
POWERDOWNFLAG /etc/killpower
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 90
MONITOR apc-bx1600@localhost 1 local pass master

upssched.conf

CMDSCRIPT /bin/upssched-cmd

Permissões de arquivo

-rw-r--r-- 1 root root  1113 Jan 22 23:40 hosts.conf
-rw-r----- 1 root nut     15 Jan 22 17:29 nut.conf
-rw-r----- 1 root nut    248 Jan 22 23:12 ups.conf
-rw-r----- 1 root nut     19 Jan 22 23:29 upsd.conf
-rw-r----- 1 root nut    253 Jan 23 16:53 upsd.users
-rw-r----- 1 root nut    232 Jan 23 17:27 upsmon.conf
-rw-r----- 1 root nut   4201 Jan 25  2023 upssched.conf
-rw-r--r-- 1 root root  1432 Jan 23 11:23 upsset.conf
-rw-r--r-- 1 root root  3699 Jan 25  2023 upsstats.html
-rw-r--r-- 1 root root  6408 Jan 25  2023 upsstats-single.html

Exemplo de um controle remoto: insira a descrição da imagem aqui

nut
  • 1 respostas
  • 97 Views
Martin Hope
PowerGnom
Asked: 2025-01-28 23:25:31 +0800 CST

Como criar uma verificação de tempo de atividade com rótulos de usuário usando o Google Cloud CLI (gcloud)

  • 5

Estou tentando criar uma verificação de uptime no Google Cloud Platform usando o cliente de linha de comando gcloud. Este é um exemplo:

gcloud monitoring uptime create 'example uptime check' --resource-labels=host=...,project_id=... --resource-type=uptime-url --protocol=https --port=443 "--path=..." --request-method=get --validate-ssl=true --status-codes=200 --matcher-type=contains-string "--matcher-content=..." --period=5 --timeout=30 --user-labels=instance-group=production,instance-type=authentication,monitoring-type=uptime

Isso geralmente funciona, ou seja, a verificação de uptime é criada e nenhum erro é relatado. No entanto, meus rótulos de usuário são silenciosamente ignorados.

Acredito que estou seguindo a documentação ( https://cloud.google.com/sdk/gcloud/reference/monitoring/uptime/create ) corretamente:

    --user-labels=[KEY=VALUE,…]
        List of label KEY=VALUE pairs to add.
        Keys must start with a lowercase character and contain only hyphens (-), 
        underscores (_), lowercase characters, and numbers. Values must contain only 
        hyphens (-), underscores (_), lowercase characters, and numbers.

Adicionei com sucesso rótulos de usuário muito semelhantes para calcular instâncias, discos etc.

Também tentei adicionar rótulos de usuário às verificações de tempo de atividade existentes via gcloud monitoring uptime update, mas isso também não funcionou.

Atualização: Criei um relatório de bug conforme sugerido por Daniel T.: https://issuetracker.google.com/issues/393989630

google-cloud-platform
  • 1 respostas
  • 35 Views
Martin Hope
E. K.
Asked: 2025-01-28 18:00:30 +0800 CST

O que causa `dkim=permerror` em todos os e-mails recebidos(!), mas os e-mails enviados são assinados e recebidos normalmente?

  • 6

Quais são as causas potenciais para a configuração de verificação de e-mails recebidos(!) do OpenDKIM dkim=permerrorno Authentication-Resultscabeçalho de cada e-mail recebido? Isso inclui aqueles e-mails que passam se eu os enviar para outra caixa de correio administrada por algum provedor que define dkim=passpara eles. Então eu sei que apenas meu OpenDKIM pensa que esses e-mails de alguma forma não passam, e isso afeta todos os remetentes de todos os lugares.

Estou com dificuldade para encontrar informações na internet sobre as diferentes causas permerrordisso.

E o que poderia fazer com que o motivo exato do erro fosse omitido? Estranhamente, não há parênteses adicionados, o que vejo mencionado na internet às vezes, como permerror (no key), mas meu OpenDKIM não parece fazer isso por algum motivo.

A configuração do OpenDKIM que eu uso é bem curta:

PidFile   /var/run/opendkim/opendkim.pid

SignHeaders   From,Sender,To,CC,Subject,Message-Id,Date

OversignHeaders   From,Sender,To,CC,Subject,Message-Id,Date

AlwaysAddARHeader   yes

Mode   sv

UserID   opendkim

ExternalIgnoreList   <myemaildomain here>, localhost

InternalHosts   <myemaildomain here>

KeyTable   /etc/opendkim/KeyTable.txt

SigningTable   refile:/etc/opendkim/SigningTable.txt

Omiti os arquivos da tabela de chaves e da tabela de assinaturas, pois o e-mail de saída funciona perfeitamente de qualquer maneira. O problema são apenas as verificações do que os outros me enviam.

Embora eu esteja interessado em uma resposta genérica, esta é a versão específica do OpenDKIM que eu uso:

# opendkim -V
opendkim: OpenDKIM Filter v2.11.0
    Compiled with OpenSSL 3.3.2 3 Sep 2024
    SMFI_VERSION 0x1000001
    libmilter version 1.0.1
    Supported signing algorithms:
        rsa-sha1
        rsa-sha256
        ed25519-sha256
    Supported canonicalization algorithms:
        relaxed
        simple
    libopendkim 2.11.0:
email
  • 1 respostas
  • 109 Views
Martin Hope
evghenii
Asked: 2025-01-28 01:23:16 +0800 CST

Usando a cadeia OUTPUT em Iptables

  • 5

Tento redirecionar pacotes, saindo em 127.0.0.1:8095 para outro host na minha rede local 10.11.12.5 : 22 . Por exemplo, gostaria de implementar:

ssh [email protected] -p 8095 

e ser redirecionado para

ssh [email protected] 

Estou usando a cadeia OUTPUT da tabela nat:

iptables -t NAT -A OUTPUT -p tcp --dport 8095 -j DNAT --to-destination 10.11.12.5:22

mas não funciona. Tentei expandir a regra acima usando opções como:

-o lo
--source 127.0.0.1
--destination 127.0.0.1

mas ninguém ajudou a lidar com esse problema. Eu também tenho no meu /etc/sysctl.conf:

net.ipv4.ip_forward = 1
net.ipv4.conf.eth0.route_localnet = 1

Você poderia, por favor, explicar o que estou fazendo errado?

linux
  • 1 respostas
  • 31 Views
Martin Hope
Olexandr Strelchenko
Asked: 2025-01-27 22:17:48 +0800 CST

Conexão de armazenamento de canal de fibra a um servidor executando proxmox

  • 5

Tenho dois servidores HP Proliant DL360 gen9 e armazenamento Dell PowerVault MD3600f. O objetivo é configurar um cluster de dois servidores proxmox com armazenamento fc compartilhado e alta disponibilidade.

O Vault é configurado para ter um único disco virtual mapeado para o grupo de hosts que contém ambos os servidores. Usei a ferramenta MDSM para isso, ela automaticamente pegou WWNs de portas fc do servidor.

O Vault é conectado diretamente a ambos os servidores usando uma porta por conexão.

No lado do servidor, o vault não aparece como um dispositivo de bloco:

# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda                  8:0    0 298.1G  0 disk 
├─sda1               8:1    0  1007K  0 part 
├─sda2               8:2    0     1G  0 part /boot/efi
└─sda3               8:3    0 297.1G  0 part 
  ├─pve-swap       252:0    0     8G  0 lvm  [SWAP]
  ├─pve-root       252:1    0  84.3G  0 lvm  /
  ├─pve-data_tmeta 252:2    0   1.9G  0 lvm  
  │ └─pve-data     252:4    0   185G  0 lvm  
  └─pve-data_tdata 252:3    0   185G  0 lvm  
    └─pve-data     252:4    0   185G  0 lvm

Não presente na lista de dispositivos SCSI:

# lsscsi -g
[0:0:0:0]    storage HP       P440ar           7.00  -          /dev/sg0 
[0:1:0:0]    disk    HP       LOGICAL VOLUME   7.00  /dev/sda   /dev/sg1 

Alguma sugestão do que pode estar errado e como depurar? Acho que o problema está na configuração do MD3600f, mas o MDSM mal permite qualquer configuração, não há muito o que bagunçar aí.

hp-proliant
  • 1 respostas
  • 42 Views
Martin Hope
Zephyr Mays
Asked: 2025-01-27 21:54:54 +0800 CST

A configuração do Nginx não consegue atender o aplicativo Node.js não localizado na raiz da web

  • 5

Meta

Com um servidor web Nginx, execute um aplicativo Node.js autônomo que serve páginas dinâmicas em resposta a chamadas de API (por exemplo, ../tempestvue/.next/standalone/.next/server/app/api/weather/route.js).

Problema/questão

Com o servidor Node.js em execução via pm2, a configuração do Nginx serve apenas uma página estática do projeto; nenhum tráfego está chegando ao servidor . O resultado é o mesmo via curlou navegador.

Além disso, ao inspecionar a página no navegador Dev Tools->Network Tab, vejo erros 404 para caminhos como este: https://www.westwindwebworks.com/tempestvue/_next/static/chunks/webpack-d8cdd8b109dd43bc.js.

Como posso atualizar a configuração para acessar os ativos 404?

Navegador com aba de rede mostra caminhos 404

Atualização: Final

Está ao vivo, VEJA AQUI !

No final das contas, o problema estava principalmente em como o standalone estava sendo construído. Para que o aplicativo standalone seja servido, www.domain.com/tempestvueele precisa de três coisas:

  1. Um next.config.mjscom:

    1. output: "standalone",
    2. basePath: "/tempestvue",
    3. trailingSlash: true,
  2. Uma estrutura de diretório como esta após a compilação:

    .next/
      standalone/
        .next/           
        node_modules/    # Minimal set of dependencies for the app
        .env.production  # Server-side variables
        package.json     # Contains dependencies required to run the app
        server.js        # The entry point for the Node.js server
        static/          # Static assets copied here during build process
    public/              # Public directory added to build.tar.gz
    

    O que é realizado com este comando de construção:

    "build:release": "NODE_ENV=production next build && cp -r .next/static .next/standalone/.next/static && npm run release && tar --exclude=.git -czf build.tar.gz .next/standalone public",

  3. Um bloco de configuração de localização de servidor para fazer proxy da porta na qual o aplicativo está escutando.

    # ------------------------------
    # Add a location block for TempestVue
    # ------------------------------
    location /tempestvue/ {
        proxy_pass http://127.0.0.1:3000;
        proxy_redirect default;
        proxy_http_version 1.1;

        # Recommended proxy headers:
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Host $host;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection 'upgrade';
    }

Depois disso, usei ações do GitHub para copiar e descompactar build.tar.gzna estrutura de diretório indicada abaixo na seção de segundo plano e iniciar server.jscom pm2.

Por fim, a estrutura de diretório do servidor não precisou de ajustes, conforme contemplado na resposta aceita.

( Muito obrigado a @Ivan Shatsky por ajudar a resolver isso! )

Atualização 1:

Na produção, o navegador alcança o publicdiretório e parece estar procurando pelo server.js no mesmo nível, quando na verdade está executando um nível de diretório abaixo: /home/ec2-user/tempestvue/releases/20250128-013558/.next/standalone/server.js

Retorna https://www.westwindwebworks.com/tempestvue/_next/static/css/79b4bd61dccf868b.css404 porque o caminho real para esse ativo é: https://www.westwindwebworks.com/tempestvue/_next/stanalone/static/css/79b4bd61dccf868b.css?

caminhobase enext.config.mjs

import dotenv from "dotenv";
import path from "path";

const isProd = process.env.NODE_ENV === "production";
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  basePath: isProd ? "/tempestvue" : "", // Adjust basePath for production
  trailingSlash: true, // Recommended for apps with a basePath
  //reactStrictMode: false, // Disable React strict mode

  env: {
    BASE_PATH: process.env.BASE_PATH,
    NEXT_PUBLIC_BASE_PATH: process.env.NEXT_PUBLIC_BASE_PATH,
    REACT_APP_BASE_PATH: process.env.REACT_APP_BASE_PATH,
  },

  webpack: (config) => {
    config.optimization.minimize = false; // Ensure no minification
    config.externals = [...config.externals, { canvas: "canvas" }]; // Required for Chart.js
    return config;
  },
};

// Determine the environment file
const envFile =
  process.env.NODE_ENV === "production" ? ".env.production" : ".env.local";
console.log(`Using environment file: ${envFile}`);

// Load .env.production or .env.local
dotenv.config({ path: path.resolve(process.cwd(), envFile) });

export default {
  ...nextConfig,
  output: "standalone",
  env: {
    ...Object.keys(process.env)
      .filter((key) => key.startsWith("NEXT_PUBLIC_")) // Only public variables are included
      .reduce((env, key) => {
        env[key] = process.env[key];
        return env;
      }, {}),
  },
};

Fundo

No servidor de implantação, a estrutura de diretório usa um único link simbólico na pasta raiz do projeto /tempestvuepara apontar para a versão atual.

/home/ec2-user/
          └── tempestvue
              ├── 20250127-031305 -> /home/ec2-user/tempestvue/releases/20250127-031305
              │   ├── ._public
              │   ├── .next
              │   │   ├── ._standalone
              │   │   ├── ._static
              │   │   ├── standalone
              │   │   └── static
              │   └── public
              │       ├── ._TempestVue.png
              │       ├── ._apple-icon copy.png
              │       ├── ._favicon.svg
              │       ├── ._globals.css
              │       ├── ._icon.png
              │       ├── ._manifest.json
              │       ├── TempestVue.png
              │       ├── apple-icon copy.png
              │       ├── favicon.svg
              │       ├── globals.css
              │       ├── icon.png
              │       └── manifest.json
              └── releases
                  ├── 20250126-011024
                  │   └── .next
                  ├── 20250126-202835
                  │   └── .next
                  ├── 20250126-220617
                  │   └── .next
                  ├── 20250126-231144
                  │   └── .next
                  └── 20250127-031305
                      ├── ._public
                      ├── .next
                      └── public

Implantação

Servidor Node.js em execução pm2aqui: /home/ec2-user/tempestvue/releases/20250127-031305/.next/standalone/server.js

Configuração do servidor

Nota: editado para refletir a versão atualmente em uso.

# Main server block for www
server {
    server_name www.westwindwebworks.com;
    root         /usr/share/nginx/html;


    # ------------------------------
    # Add a location block for TempestVue
    # ------------------------------
    location /tempestvue/ {
        proxy_pass http://127.0.0.1:3000;
        proxy_redirect default;
        proxy_http_version 1.1;

        # Recommended proxy headers:
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Host $host;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection 'upgrade';
    }

    # Load configuration files for the default server block.
    # include /etc/nginx/default.d/*.conf;

    error_page 404 /404.html;
    location = /404.html {
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    }

    ...HTTPS stuff...
}

Testando

[ec2-user@ip-172-31-24-45 tempestvue]$ curl -i https://www.westwindwebworks.com/tempestvue/ | html-beautifyretorna uma página estática do projeto:

Nota: editado para ser breve, resposta completa no final do post.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13307    0 13307    0     0  94041      0 --:--:-- --:--:-- --:--:-- 95050
HTTP/1.1 404 Not Found
Server: nginx/1.26.2
Date: Mon, 27 Jan 2025 12:39:03 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate
Vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding
X-Powered-By: Next.js

<!DOCTYPE html>
<html lang="en" class="dark">

<head>
    <meta charSet="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="/tempestvue/_next/static/css/79b4bd61dccf868b.css" data-precedence="next" />
    <link rel="preload" as="script" fetchPriority="low" href="/tempestvue/_next/static/chunks/webpack-d8cdd8b109dd43bc.js" />
    <script src="/tempestvue/_next/static/chunks/4bd1b696-1aaacd546f10f1e9.js" async=""></script>
    <script src="/tempestvue/_next/static/chunks/517-2fa7b8a64c116b65.js" async=""></script>
    <script src="/tempestvue/_next/static/chunks/main-app-dae125d39e3a4f3f.js" async=""></script>
    <meta name="robots" content="noindex" />
    <link rel="shortcut icon" href="/icon.png" />
    <link rel="apple-touch-icon" href="/apple-icon.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/icon.png" />
    <title>404: This page could not be found.</title>
    <title>TempestVue</title>
    <meta name="description" content="Real-time weather visualization dashboard." />
    <link rel="manifest" href="/manifest.json" />
    <meta property="og:title" content="Tempest Weather | Sand Hills Beach, Scituate, MA" />
    <meta property="og:description" content="Real-time weather conditions and forecast for Sand Hills Beach, Scituate, MA" />
    <meta property="og:url" content="https://www.westwindwedworks.com/tempestvue/" />
    <meta property="og:site_name" content="Tempest Weather" />
    <meta property="og:locale" content="en_US" />
    <meta property="og:image" content="https://www.westwindwedworks.com/tempestvue/og-image.png" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />
    <meta property="og:type" content="website" />
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:title" content="Tempest Weather | Sand Hills Beach, Scituate, MA" />
    <meta name="twitter:description" content="Real-time weather conditions and forecast for Sand Hills Beach, Scituate, MA" />
    <meta name="twitter:image" content="https://www.westwindwedworks.com/tempestvue/og-image.png" />
    <meta name="twitter:image:width" content="1200" />
    <meta name="twitter:image:height" content="630" />
    <link rel="shortcut icon" href="/icon.png" />
    <link rel="icon" href="/favicon-16x16.png" sizes="16x16" type="image/png" />
    <link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png" />
    <link rel="icon" href="/favicon-48x48.png" sizes="48x48" type="image/png" />
    <link rel="apple-touch-icon" href="/apple-icon.png" sizes="180x180" type="image/png" />
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
    <script src="/tempestvue/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script>
</head>
<body>
  ...
</body>

Com uma URL incorreta ~]$ curl -i https://www.westwindwebworks.com/tempestvu/ | html-beautifyretorna a página genérica Nginx 404 da raiz da web /usr/share/nginx/html:

[ec2-user@ip-172-31-24-45 ~]$ curl -i https://www.westwindwebworks.com/tempestvu/ | html-beautify
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3650  100  3650    0     0  32791      0 --:--:-- --:--:-- --:--:-- 32882
HTTP/1.1 404 Not Found
Server: nginx/1.26.2
Date: Mon, 27 Jan 2025 12:57:47 GMT
Content-Type: text/html
Content-Length: 3650
Connection: keep-alive
ETag: "6793f381-e42"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
    <title>The page is not found</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <style type="text/css">
    ...
    </style>
</head>

<body>
    <h1><strong>nginx error!</strong></h1>

    <div class="content">

        <h3>The page you are looking for is not found.</h3>
        ....
    </div>
</body>

Resposta não editada para futuras investigações

<!DOCTYPE html>
<html lang="en" class="dark">

<head>
    <meta charSet="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="/tempestvue/_next/static/css/79b4bd61dccf868b.css" data-precedence="next" />
    <link rel="preload" as="script" fetchPriority="low" href="/tempestvue/_next/static/chunks/webpack-d8cdd8b109dd43bc.js" />
    <script src="/tempestvue/_next/static/chunks/4bd1b696-1aaacd546f10f1e9.js" async=""></script>
    <script src="/tempestvue/_next/static/chunks/517-2fa7b8a64c116b65.js" async=""></script>
    <script src="/tempestvue/_next/static/chunks/main-app-dae125d39e3a4f3f.js" async=""></script>
    <meta name="robots" content="noindex" />
    <link rel="shortcut icon" href="/icon.png" />
    <link rel="apple-touch-icon" href="/apple-icon.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/icon.png" />
    <title>404: This page could not be found.</title>
    <title>TempestVue</title>
    <meta name="description" content="Real-time weather visualization dashboard." />
    <link rel="manifest" href="/manifest.json" />
    <meta property="og:title" content="Tempest Weather | Sand Hills Beach, Scituate, MA" />
    <meta property="og:description" content="Real-time weather conditions and forecast for Sand Hills Beach, Scituate, MA" />
    <meta property="og:url" content="https://www.westwindwedworks.com/tempestvue/" />
    <meta property="og:site_name" content="Tempest Weather" />
    <meta property="og:locale" content="en_US" />
    <meta property="og:image" content="https://www.westwindwedworks.com/tempestvue/og-image.png" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />
    <meta property="og:type" content="website" />
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:title" content="Tempest Weather | Sand Hills Beach, Scituate, MA" />
    <meta name="twitter:description" content="Real-time weather conditions and forecast for Sand Hills Beach, Scituate, MA" />
    <meta name="twitter:image" content="https://www.westwindwedworks.com/tempestvue/og-image.png" />
    <meta name="twitter:image:width" content="1200" />
    <meta name="twitter:image:height" content="630" />
    <link rel="shortcut icon" href="/icon.png" />
    <link rel="icon" href="/favicon-16x16.png" sizes="16x16" type="image/png" />
    <link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png" />
    <link rel="icon" href="/favicon-48x48.png" sizes="48x48" type="image/png" />
    <link rel="apple-touch-icon" href="/apple-icon.png" sizes="180x180" type="image/png" />
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
    <script src="/tempestvue/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script>
</head>
<body class="bg-gradient-to-br from-gray-950 to-gray-900 text-white min-h-screen antialiased">
    <header class="w-full  h-14 md:h-16 lg:h-18  px-2 sm:px-4 md:px-6 lg:px-8  py-2 md:py-2.5 border-b border-white/10  backdrop-blur-md fixed top-0 z-50  bg-gradient-to-r from-blue-400/30 via-purple-400/30 to-blue-400/30">
        <div class="max-w-7xl mx-auto h-full relative">
            <div class="h-full flex items-center justify-center">
                <h1 class="text-lg sm:text-xl md:text-2xl lg:text-3xl xl:text-4xl  font-bold text-center tracking-tight"><span class="weather-text-gradient">TempestVue v1</span></h1>
            </div>
        </div>
    </header>
    <main class="pt-14 md:pt-16 lg:pt-18">
        <div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center">
            <div>
                <style>
                    body {
                        color: #000;
                        background: #fff;
                        margin: 0
                    }

                    .next-error-h1 {
                        border-right: 1px solid rgba(0, 0, 0, .3)
                    }

                    @media (prefers-color-scheme:dark) {
                        body {
                            color: #fff;
                            background: #000
                        }

                        .next-error-h1 {
                            border-right: 1px solid rgba(255, 255, 255, .3)
                        }
                    }
                </style>
                <h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1>
                <div style="display:inline-block">
                    <h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2>
                </div>
            </div>
        </div>
    </main>
    <script src="/tempestvue/_next/static/chunks/webpack-d8cdd8b109dd43bc.js" async=""></script>
    <script>
        (self.__next_f = self.__next_f || []).push([0])
    </script>
    <script>
        self.__next_f.push([1, "1:\"$Sreact.fragment\"\n2:I[5244,[],\"\"]\n3:I[3866,[],\"\"]\n4:I[6213,[],\"OutletBoundary\"]\n6:I[6213,[],\"MetadataBoundary\"]\n8:I[6213,[],\"ViewportBoundary\"]\na:I[4835,[],\"\"]\n:HL[\"/tempestvue/_next/static/css/79b4bd61dccf868b.css\",\"style\"]\n"])
    </script>
nginx
  • 2 respostas
  • 102 Views
Martin Hope
Hvprvtr
Asked: 2025-01-27 20:10:28 +0800 CST

O módulo Ansible ansible.builtin.user não funciona com caixas genéricas do Ubuntu

  • 5

Tente fazer o up generic/ubuntu18(20|22) image e adicione usuários lá pelo módulo ansible.builtin.user. Vai bem, mas o usuário não está adicionando realmente. Por que vai?

Ansible: 2.16.3

Vagabundo: 2.4.3

Sistema operacional host: Ubuntu 24.04

  config.vm.define "ubuntu18" do |ubuntu18|
    ubuntu18.vm.box = "generic/ubuntu1804"

    ubuntu18.vm.boot_timeout = 600
    ubuntu18.vm.hostname = "ubuntu18"

    ubuntu18.vm.network :private_network, ip: "192.168.56.15"

    PLAYBOOKS = [
         "ansible/nix-local-users.yml",
    ]
    PLAYBOOKS.each do |playbook|
        ubuntu18.vm.provision "ansible" do |ansible|
          ansible.playbook = playbook
          ansible.verbose = "vvv"
          ansible.extra_vars = {
              target_host: "ubuntu18"
          }
        end
    end
  end

E o manual:

---
- hosts: "{{ target_host }}"
  connection: local
  become: yes
  become_user: root
  become_method: sudo
  tasks:
    - name: Create a local nix users
      ansible.builtin.user:
        name: "{{ item.login }}"
        password: "*"
        state: present
#        password: "{{ item.password | password_hash('sha512') }}"
        create_home: yes
      with_items:
        - { login: 'LocalUser1', password: '1Passw0rd@' }
        - { login: 'LocalUser2', password: '2Passw0rd@' }
        - { login: 'LocalUser3', password: '3Passw0rd@' }

Esta saída foi obtida quando executei "vagrant up ubuntu18".

Bringing machine 'ubuntu18' up with 'virtualbox' provider...
==> ubuntu18: Importing base box 'generic/ubuntu1804'...
==> ubuntu18: Matching MAC address for NAT networking...
==> ubuntu18: Setting the name of the VM: test_ubuntu18_1737979065436_47140
==> ubuntu18: Fixed port collision for 22 => 2222. Now on port 2200.
==> ubuntu18: Clearing any previously set network interfaces...
==> ubuntu18: Preparing network interfaces based on configuration...
    ubuntu18: Adapter 1: nat
    ubuntu18: Adapter 2: hostonly
==> ubuntu18: Forwarding ports...
    ubuntu18: 22 (guest) => 2200 (host) (adapter 1)
==> ubuntu18: Running 'pre-boot' VM customizations...
==> ubuntu18: Booting VM...
==> ubuntu18: Waiting for machine to boot. This may take a few minutes...
    ubuntu18: SSH address: 127.0.0.1:2200
    ubuntu18: SSH username: vagrant
    ubuntu18: SSH auth method: private key
    ubuntu18: 
    ubuntu18: Vagrant insecure key detected. Vagrant will automatically replace
    ubuntu18: this with a newly generated keypair for better security.
    ubuntu18: 
    ubuntu18: Inserting generated public key within guest...
    ubuntu18: Removing insecure key from the guest if it's present...
    ubuntu18: Key inserted! Disconnecting and reconnecting using new SSH key...
==> ubuntu18: Machine booted and ready!
==> ubuntu18: Checking for guest additions in VM...
    ubuntu18: The guest additions on this VM do not match the installed version of
    ubuntu18: VirtualBox! In most cases this is fine, but in rare cases it can
    ubuntu18: prevent things such as shared folders from working properly. If you see
    ubuntu18: shared folder errors, please make sure the guest additions within the
    ubuntu18: virtual machine match the version of VirtualBox you have installed on
    ubuntu18: your host and reload your VM.
    ubuntu18: 
    ubuntu18: Guest Additions Version: 5.2.42
    ubuntu18: VirtualBox Version: 7.0
==> ubuntu18: Setting hostname...
==> ubuntu18: Configuring and enabling network interfaces...
==> ubuntu18: Running provisioner: ansible...
    ubuntu18: Running ansible-playbook...
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit="ubuntu18" --inventory-file=/test/.vagrant/provisioners/ansible/inventory --extra-vars=\{\"target_host\":\"ubuntu18\"\} -vvv ansible/nix-local-users.yml
ansible-playbook [core 2.17.7]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/study/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/study/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-playbook
  python version = 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /test/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory as it did not pass its verify_file() method
script declined parsing /test/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory as it did not pass its verify_file() method
auto declined parsing /test/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory as it did not pass its verify_file() method
Parsed /test/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory inventory source with ini plugin
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: nix-local-users.yml **************************************************
1 plays in ansible/nix-local-users.yml

PLAY [ubuntu18] ****************************************************************

TASK [Gathering Facts] *********************************************************
task path: /test/ansible/nix-local-users.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: study
<127.0.0.1> EXEC /bin/sh -c 'echo ~study && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/study/.ansible/tmp `"&& mkdir "` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236 `" && echo ansible-tmp-1737979102.1509817-523943-230847070365236="` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236 `" ) && sleep 0'
<ubuntu18> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'python3.12'"'"'; command -v '"'"'python3.11'"'"'; command -v '"'"'python3.10'"'"'; command -v '"'"'python3.9'"'"'; command -v '"'"'python3.8'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python3'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.12 && sleep 0'
<ubuntu18> Python interpreter discovery fallback (unsupported Linux distribution: ubuntu)
Using module file /usr/lib/python3/dist-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/study/.ansible/tmp/ansible-local-5239273kodvnsp/tmpxuv0pdbw TO /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/ /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-cgihllizftbsohvxjezexndfhosuwwji ; /usr/bin/python3.12 /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/AnsiballZ_setup.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/study/.ansible/tmp/ansible-tmp-1737979102.1509817-523943-230847070365236/ > /dev/null 2>&1 && sleep 0'
[WARNING]: Platform linux on host ubuntu18 is using the discovered Python
interpreter at /usr/bin/python3.12, but future installation of another Python
interpreter could change the meaning of that path. See
https://docs.ansible.com/ansible-
core/2.17/reference_appendices/interpreter_discovery.html for more information.
ok: [ubuntu18]

TASK [Create a local nix users] ************************************************
task path: /test/ansible/nix-local-users.yml:10
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: study
<127.0.0.1> EXEC /bin/sh -c 'echo ~study && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/study/.ansible/tmp `"&& mkdir "` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742 `" && echo ansible-tmp-1737979102.789001-524110-46585659397742="` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/user.py
<127.0.0.1> PUT /home/study/.ansible/tmp/ansible-local-5239273kodvnsp/tmpv012owpg TO /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/AnsiballZ_user.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/ /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/AnsiballZ_user.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-mleatpfjsqwveasahcifudyghhrkuzwq ; /usr/bin/python3.12 /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/AnsiballZ_user.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/study/.ansible/tmp/ansible-tmp-1737979102.789001-524110-46585659397742/ > /dev/null 2>&1 && sleep 0'
ok: [ubuntu18] => (item={'login': 'LocalUser1', 'password': '1Passw0rd@'}) => {
    "ansible_loop_var": "item",
    "append": false,
    "changed": false,
    "comment": "",
    "group": 1002,
    "home": "/home/LocalUser1",
    "invocation": {
        "module_args": {
            "append": false,
            "authorization": null,
            "comment": null,
            "create_home": true,
            "expires": null,
            "force": false,
            "generate_ssh_key": null,
            "group": null,
            "groups": null,
            "hidden": null,
            "home": null,
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "LocalUser1",
            "non_unique": false,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "password_expire_max": null,
            "password_expire_min": null,
            "password_expire_warn": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": null,
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on Dev",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": false,
            "uid": null,
            "umask": null,
            "update_password": "always"
        }
    },
    "item": {
        "login": "LocalUser1",
        "password": "1Passw0rd@"
    },
    "move_home": false,
    "name": "LocalUser1",
    "password": "NOT_LOGGING_PASSWORD",
    "shell": "/bin/sh",
    "state": "present",
    "uid": 1002
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~study && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/study/.ansible/tmp `"&& mkdir "` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064 `" && echo ansible-tmp-1737979102.9724927-524110-48708649402064="` echo /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/user.py
<127.0.0.1> PUT /home/study/.ansible/tmp/ansible-local-5239273kodvnsp/tmp4tqlyxfh TO /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/AnsiballZ_user.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/ /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/AnsiballZ_user.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-bcaxqjzbaqhsvieolltmbltywjjyhyke ; /usr/bin/python3.12 /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/AnsiballZ_user.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/study/.ansible/tmp/ansible-tmp-1737979102.9724927-524110-48708649402064/ > /dev/null 2>&1 && sleep 0'
ok: [ubuntu18] => (item={'login': 'LocalUser2', 'password': '2Passw0rd@'}) => {
    "ansible_loop_var": "item",
    "append": false,
    "changed": false,
    "comment": "",
    "group": 1003,
    "home": "/home/LocalUser2",
    "invocation": {
        "module_args": {
            "append": false,
            "authorization": null,
            "comment": null,
            "create_home": true,
            "expires": null,
            "force": false,
            "generate_ssh_key": null,
            "group": null,
            "groups": null,
            "hidden": null,
            "home": null,
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "LocalUser2",
            "non_unique": false,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "password_expire_max": null,
            "password_expire_min": null,
            "password_expire_warn": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": null,
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on Dev",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": false,
            "uid": null,
            "umask": null,
            "update_password": "always"
        }
    },
    "item": {
        "login": "LocalUser2",
        "password": "2Passw0rd@"
    },
    "move_home": false,
    "name": "LocalUser2",
    "password": "NOT_LOGGING_PASSWORD",
    "shell": "/bin/sh",
    "state": "present",
    "uid": 1003
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~study && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/study/.ansible/tmp `"&& mkdir "` echo /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436 `" && echo ansible-tmp-1737979103.0961325-524110-27042937232436="` echo /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/user.py
<127.0.0.1> PUT /home/study/.ansible/tmp/ansible-local-5239273kodvnsp/tmpk4vulkhv TO /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/AnsiballZ_user.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/ /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/AnsiballZ_user.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-xyazghqxggmfaljuxketsxytgkcbtwuk ; /usr/bin/python3.12 /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/AnsiballZ_user.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/study/.ansible/tmp/ansible-tmp-1737979103.0961325-524110-27042937232436/ > /dev/null 2>&1 && sleep 0'
ok: [ubuntu18] => (item={'login': 'LocalUser3', 'password': '3Passw0rd@'}) => {
    "ansible_loop_var": "item",
    "append": false,
    "changed": false,
    "comment": "",
    "group": 1004,
    "home": "/home/LocalUser3",
    "invocation": {
        "module_args": {
            "append": false,
            "authorization": null,
            "comment": null,
            "create_home": true,
            "expires": null,
            "force": false,
            "generate_ssh_key": null,
            "group": null,
            "groups": null,
            "hidden": null,
            "home": null,
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "LocalUser3",
            "non_unique": false,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "password_expire_max": null,
            "password_expire_min": null,
            "password_expire_warn": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": null,
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on Dev",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": false,
            "uid": null,
            "umask": null,
            "update_password": "always"
        }
    },
    "item": {
        "login": "LocalUser3",
        "password": "3Passw0rd@"
    },
    "move_home": false,
    "name": "LocalUser3",
    "password": "NOT_LOGGING_PASSWORD",
    "shell": "/bin/sh",
    "state": "present",
    "uid": 1004
}

PLAY RECAP *********************************************************************
ubuntu18                   : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Por que ok=2 aqui? Havia 3 usuários, não 2. Quando vou para a máquina por ssh, não vejo usuários em /etc/passwd, /etc/shadow e não vejo novos diretórios home.

ubuntu
  • 1 respostas
  • 38 Views
Prev
Próximo

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve