小编Lim*_*mbo的帖子

Ansible-Playbook 文件仅导致错误 - “以下模块无法执行:ansible.legacy.setup\n”

我有一个 Ansible-Playbook 文件,该文件应该在本地主机上创建 apache2 服务器、创建/复制一些文档、安装 Git 并克隆存储库。但是,每次我尝试执行该文件时,我都会收到此错误:

\n
fatal: [myserver]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"failed": true, "module_stderr": "/usr/bin/env: \xe2\x80\x98python\xe2\x80\x99: No such file or directory\\n", "module_stdout": "", "msg": "MODULE FAILURE\\nSee stdout/stderr for the exact error", "rc": 127}}, "msg": "The following modules failed to execute: ansible.legacy.setup\\n"}\n
Run Code Online (Sandbox Code Playgroud)\n

这是我的 ansible-playbook 文件:

\n
---\n- hosts: myserver\n  become: true\n  remote_user: admin\n  vars_files:\n    - default.yml\n\n  tasks:\n    - name: Install Apache\n      apt: name=apache2 update_cache=yes state=latest\n\n- name: Create document root for domain\n  file:\n    path: …
Run Code Online (Sandbox Code Playgroud)

yaml apache2 ansible

5
推荐指数
0
解决办法
3万
查看次数

AWS S3 存储桶的 Terraform 文件不断收到错误:提供程序配置无效

编辑:我现在已经修改了问题以显示整个 main.tf 文件。

\n

我有一个 Terraform 文件,该文件应该创建一个 AWS S3 存储桶,但每次运行时我不断收到的错误之一terraform plan是:

\n
\xe2\x94\x82 Error: Invalid provider configuration\n\xe2\x94\x82 Provider "registry.terraform.io/hashicorp/aws" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider documentation.\n
Run Code Online (Sandbox Code Playgroud)\n

main.tf 文件:

\n
terraform {\n    backend  "s3" {\n    region         = "us-east-1"\n    bucket         = "bucketname"\n    key            = "path/terraform.tfstate" \n    dynamodb_table = "tf-state-lock" \n    access_key = "<access_key>"\n    secret_key = "<secret_key"\n    }\n\n    required_providers {\n      aws = {\n        version …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 amazon-web-services terraform terraform-provider-aws

1
推荐指数
1
解决办法
9001
查看次数