Last active
March 1, 2016 16:13
-
-
Save vterdunov/f8e0635a008e1fc7ba50 to your computer and use it in GitHub Desktop.
вариант запускать сервисы от колличества ядер без генерации хэша
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
vars: | |
myhashes: | |
service_name: service | |
port: 8085 | |
env: production | |
tasks: | |
- name: test | |
debug: msg="service {{ myhashes['service_name']+item }} port {{ myhashes['port']+item | int }}" | |
with_sequence: count={{ ansible_processor_vcpus }} | |
вывод: | |
TASK: [test] ****************************************************************** | |
ok: [localhost] => (item=1) => { | |
"item": "1", | |
"msg": "service service1 port 8086" | |
} | |
ok: [localhost] => (item=2) => { | |
"item": "2", | |
"msg": "service service2 port 8087" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment