简体   繁体   English

如何在AWS Lambda函数中运行Ansible Playbook

[英]how to run ansible playbook in aws lambda function

I was trying the below link method where i have uploaded the zip file to lambda function and by passing parameters executed the lambda. 我正在尝试下面的链接方法,其中我已将zip文件上传到lambda函数,并通过传递参数来执行lambda。 That throws error as follow. 这引发如下错误。 Please suggest me how to solve this , how i can run lambda with playbook 请建议我如何解决此问题,如何使用Playbook运行Lambda

[1]: https://medium.com/@jacoelho/ansible-in-aws-lambda-980bb8b5791b [1]:https://medium.com/@jacoelho/ansible-in-aws-lambda-980bb8b5791b

START RequestId: 9c140646-5a3c-430b-81cf-458aaa7cdd77 Version: $LATEST
module initialization error: Invalid settings supplied for DEFAULT_LOCAL_TMP: Unable to create local directories(/home/sbx_user1051/.ansible/tmp):

 [Errno 30] Read-only file system: '/home/sbx_user1051'
Traceback (most recent call last):
  File "/var/task/ansible/config/manager.py",

 line 489, in update_config_data
    value, origin = self.get_config_value_and_origin(config, configfile)
  File "/var/task/ansible/config/manager.py",

 line 434, in get_config_value_and_origin
    value = ensure_type(value, defs[config].get('type'), origin=origin)
  File "/var/task/ansible/config/manager.py", 

line 91, in ensure_type
    makedirs_safe(value, 0o700)
  File "/var/task/ansible/utils/path.py",

 line 81, in makedirs_safe
    raise AnsibleError("Unable to create local directories(%s): %s" % (to_native(rpath), to_native(e)))
AnsibleError: Unable to create local directories(/home/sbx_user1051/.ansible/tmp): [Errno 30] Read-only file system: '/home/sbx_user1051'

END RequestId: 9c140646-5a3c-430b-81cf-458aaa7cdd77
REPORT RequestId: 9c140646-5a3c-430b-81cf-458aaa7cdd77  Duration: 45.12 ms  Billed Duration: 100 ms     Memory Size: 1472 MB    Max Memory Used: 65 MB  
module initialization error
Invalid settings supplied for DEFAULT_LOCAL_TMP: Unable to create local directories(/home/sbx_user1051/.ansible/tmp): [Errno 30] Read-only file system: '/home/sbx_user1051'
Traceback (most recent call last):
  File "/var/task/ansible/config/manager.py",

 line 489, in update_config_data
    value, origin = self.get_config_value_and_origin(config, configfile)
  File "/var/task/ansible/config/manager.py",

 line 434, in get_config_value_and_origin
    value = ensure_type(value, defs[config].get('type'), origin=origin)
  File "/var/task/ansible/config/manager.py", 

line 91, in ensure_type
    makedirs_safe(value, 0o700)
  File "/var/task/ansible/utils/path.py", 

line 81, in makedirs_safe
    raise AnsibleError("Unable to create local directories(%s): %s" % (to_native(rpath), to_native(e)))

AnsibleError: Unable to create local directories(/home/sbx_user1051/.ansible/tmp): [Errno 30] Read-only file system: '/home/sbx_user1051'

You did not change the temp directory as indicated in the post: 您没有按照帖子中的指示更改临时目录:

# use /tmp instead of $HOME
ansible.constants.DEFAULT_REMOTE_TMP = '/tmp/ansible'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 docker 容器上运行 ansible-playbook 以在 AWS EC2 Ubuntu 实例上执行命令? - How can I run ansible-playbook on docker container to execute commands on an AWS EC2 Ubuntu instance? 是否可以从Chef AWS / Opworks食谱中运行Ansible剧本? - Is it possible to run an Ansible playbook from a Chef AWS/Opworks cookbook? 如何在 ansible-playbook 中查找 amazon.aws.aws_secret? - How to lookup an amazon.aws.aws_secret in ansible-playbook? 如何在“aws lambda”函数中运行“AWS CLI”命令? - How to run `AWS CLI` command within `aws lambda` function? 使用Ansible创建EC2后如何运行Playbook - How to run playbook after creating ec2 with ansible 无法运行 AWS lambda function - Unable to run AWS lambda function 如何在ansible playbook中动态使用AWS实例的IP地址,而不使用ansible playbook将其保存在外部文件中 - how to use AWS instance's IP address dynamically in an ansible playbook without saving it in an external file using ansible playbook 如何在 AWS S3 中为多个文件运行 Lambda 函数 - How to run Lambda function for multiples files in AWS S3 您如何运行(“调用”)AWS Lambda函数? - How do you run ('invoke') an AWS lambda function? 如何使用 SAM 在本地运行 C++ AWS Lambda Function? - How to run a C++ AWS Lambda Function locally with SAM?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM