Comments (10)
HI @mick1627 I am sorry for late reply. Can you share me the error when running alicloud_ecs.py with python 3.8?
from alibaba.alicloud.
@amolari Can you share us the error when running alicloud_ecs.py with python 3.8?
from alibaba.alicloud.
@zopcorn There is no error, but the filtering is ignored.
from alibaba.alicloud.
@amolari Do you want to get some instances by filters dynamically? If so, you can refer to https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html#other-inventory-scripts .
from alibaba.alicloud.
@xiaozhu36 : we're using AWX/tower, so filter partly dynamically through limits. However, we need some pre-filtering (for safety) at the inventory level too. That was working perfectly before using Pythong 3.8.
from alibaba.alicloud.
@amolari would you please try to use aliyun-python-sdk-ecs with version 2.1.3 ? Since we do not have your ansible playbook, we are not able to test it.
from alibaba.alicloud.
filters on tags is now working with pip module aliyun-python-sdk-ecs version 4.24.22
But now I have an other issue setting setting hostname variables to a specific tag does not work anymore.
Here my alicloud.yml file
plugin: alicloud_ecs
alicloud_region: cn-shanghai
keyed_groups:
# add hosts to instance_type groups
- prefix: instance_type
key: instance_type
# add hosts to instance_name groups
- key: instance_name
prefix: name
- key: availability_zone
prefix: ''
separator: ''
- key: "availability_zone | regex_replace('^(.*)-[^-]+$', '\\1')"
prefix: ''
separator: ''
- key: tags
prefix: tag
parent_group: tags
cache: false
cache_plugin: jsonfile
cache_timeout: 7200
cache_connection: /tmp/alicloud_inventory
cache_prefix: alicloud_ecs
# Add hosts to group based on Jinja2 conditionals
groups:
# add hosts to the group Spinnaker if instance_name starts with 'k8sSpinnaker'
# Spinnaker: instance_name.startswith('k8sSpinnaker')
# Create vars from jinja2 expressions
compose:
# set the ansible_host variable to connect with the public ip address without changing the hostnames
ansible_host: private_ip_address
#If true make invalid entries a fatal error, otherwise skip and continue
#Since it is possible to use facts in the expressions they might not always be available and we ignore those errors by default.
strict: false
filters:
tags:
Name: stfeagt04
hostnames:
- tags: fqdn
@zopcorn you can test the inventory plugins with the command ansible-inventory -i alicloud.yml --list
no needs to run playbook.
from alibaba.alicloud.
@mick1627 OK, let me have a check.
from alibaba.alicloud.
@xiaozhu36 any news please?
from alibaba.alicloud.
Hi @amolari @mick1627 I am sorry for late reply. This issue has been fixed the by #309 and you can build a new collection to have a try.
In addition, the hostnames
in inventory file should be as following:
hostnames:
- tag:fqdn
from alibaba.alicloud.
Related Issues (20)
- python 3.6 安装报错 HOT 1
- delete instance has error in ansible alicloud
- ali_image_info has several problems
- Not able to add backend server to existing SLB
- Add the drive encryption option
- 运行alicloud.py报错
- 什么时候能支持ECS snapshot?
- The ali_instance module doesn't support cloud_essd as a system disk category
- Inventory plugin documentation
- footmark latest version (1.20.0) can not work with the latest Python (3.9)
- Error Create SLB (Server Load Balancer)
- Feature Request: Security Group Type for ali_security_group
- Stoping an ECS instance returns error HOT 1
- Not on galaxy HOT 2
- ansible ali_instance system disk ESSD select performance level
- alicloud_ecs inventory plugin: allow to set replace_dash_in_groups = False HOT 1
- 考虑一下对阿里云dns record的支持? HOT 1
- ansible.builtin.cloud.alicloud.ali_security_group 幂等性异常问题
- ali_instance should support setting a private ip address when
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alibaba.alicloud.