Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# Copyright 2018 Bull S.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


- name: Setup Statsd Telemetry config
hosts: all
strategy: free
become_user: yorc
become: true
tasks:
- name: "get current config of Yorc"
shell: "cat {{ CONFIG_DIR }}/config.yorc.yaml"
register: result

- set_fact:
yorcConfig: "{{ result.stdout | from_yaml }}"

- set_fact:
tmp: '{ "telemetry": { "statsd_address": "{{ STATSD_IP_ADDRESS }}:{{ STATSD_IP_PORT }}", "disable_hostname": true } }'
- set_fact:
yorcConfig: "{{ yorcConfig | combine(tmp, recursive=True) }}"

- name: "Output config to file {{ CONFIG_DIR }}/config.yorc.yaml"
copy:
content: "{{ yorcConfig | to_yaml }}"
dest: "{{ CONFIG_DIR }}/config.yorc.yaml"
12 changes: 10 additions & 2 deletions org/ystia/yorc/yorc/linux/ansible/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
become: true
become_method: sudo
tasks:

- name: create Yorc group
group: name=yorc

Expand Down Expand Up @@ -61,6 +61,14 @@
group: yorc
mode: "u=rwx,g=rwx,o=rx"

- name: Setup permissions on log dir
file:
path: "{{LOG_DIR}}"
state: directory
owner: yorc
group: yorc
mode: "u=rwx,g=rwx,o=rx"

- name: Download Yorc binary
get_url:
url: "{{DOWNLOAD_URL}}"
Expand All @@ -75,7 +83,7 @@
mode: "u=rx,g=rx,o=rx"

- name: Install Yorc systemd unit
template:
template:
src: yorc.service.j2
dest: "/etc/systemd/system/yorc.service"
mode: "u=rw,g=rw,o=r"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}
resources_prefix: yorc-
resources_prefix: {{RESOURCES_PREFIX}}
workers_number: {{WORKERS_NUMBER}}
http_port: "{{REST_API_PORT}}"
server_id: "{{server_id}}"
{% if REST_API_PROTOCOL == "https" %}
Expand All @@ -22,3 +23,8 @@ key_file: "{{CONFIG_DIR}}/yorc_server.key"
cert_file: "{{CONFIG_DIR}}/yorc_server.pem"
ca_file: "{{CONFIG_DIR}}/yorc_ca.pem"
{% endif %}
ansible:
use_openssh: {{ANSIBLE_USE_OPENSSH}}
connection_retries: {{ANSIBLE_CONNECTION_RETRIES}}
hosted_operations:
unsandboxed_operations_allowed: {{ANSIBLE_HOSTED_OPERATIONS_UNSANDBOXED_OPERATIONS_ALLOWED}}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ Environment="NO_PROXY={% if ansible_env['NO_PROXY'] is defined %}{{ansible_env['
User=yorc
Group=yorc
Restart=on-failure
ExecStart={{INSTALL_DIR}}/yorc server -c {{CONFIG_DIR}}/config.yorc.yaml
ExecStart=/bin/bash -c '{{INSTALL_DIR}}/yorc server -c {{CONFIG_DIR}}/config.yorc.yaml 2>&1 >> {{LOG_DIR}}/yorc.log'
KillSignal=SIGINT
TimeoutStopSec=360
WorkingDirectory=/var/yorc
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
57 changes: 56 additions & 1 deletion org/ystia/yorc/yorc/linux/ansible/types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ imports:
- yorc-types:1.0.0
- org.ystia.yorc.pub:2.2.0-SNAPSHOT
- org.ystia.yorc.experimental.consul.pub:2.2.0-SNAPSHOT

- org.alien4cloud.statsd.pub:2.2.0-SNAPSHOT
- org.alien4cloud.grafana.pub:2.2.0-SNAPSHOT

node_types:
org.ystia.yorc.infrastructure.GoogleConfig:
Expand Down Expand Up @@ -80,12 +81,44 @@ node_types:
description: Yorc server instance
metadata:
icon: "yorcicon.png"
properties:
log_dir:
type: string
required: true
default: "/var/log/yorc"
ansible_use_openssh:
description: |
Prefer OpenSSH over Paramiko, a Python implementation of SSH (the default), to provision remote hosts.
OpenSSH has several optimizations like reusing connections that should improve preformance but may lead to issues on older systems.
type: boolean
required: true
default: true
ansible_connection_retries:
description: |
Number of retries in case of Ansible SSH connection failure.
type: integer
required: true
default: 3
ansible_hosted_operations_unsandboxed_operations_allowed:
description: |
This option controls if operations can be executed directly on the system that hosts Yorc if no default sandbox is defined.
This is not permitted by default.
type: boolean
required: true
default: false
resources_prefix:
type: string
description: |
Specify a prefix that will be used for names when creating resources such as Compute instances or volumes.
required: true
default: "yorc-"
interfaces:
Standard:
inputs:
CONFIG_DIR: { get_property: [SELF, config_dir] }
INSTALL_DIR: { get_property: [SELF, install_dir] }
DATA_DIR: { get_property: [SELF, data_dir] }
LOG_DIR: { get_property: [SELF, log_dir] }
create:
inputs:
DOWNLOAD_URL: { get_property: [SELF, download_url] }
Expand All @@ -96,6 +129,11 @@ node_types:
REST_API_PROTOCOL: { get_property: [SELF, rest, protocol] }
IP_ADDRESS: { get_attribute: [HOST, private_address] }
PUBLIC_ADDRESS: { get_attribute: [HOST, public_address] }
WORKERS_NUMBER: { get_property: [SELF, workers_number] }
RESOURCES_PREFIX: { get_property: [SELF, resources_prefix] }
ANSIBLE_USE_OPENSSH: { get_property: [SELF, ansible_use_openssh] }
ANSIBLE_CONNECTION_RETRIES: { get_property: [SELF, ansible_connection_retries] }
ANSIBLE_HOSTED_OPERATIONS_UNSANDBOXED_OPERATIONS_ALLOWED: { get_property: [SELF, ansible_hosted_operations_unsandboxed_operations_allowed] }
SSH_KEY: { get_property: [SELF, private_key_content] }
CA_PEM: { get_property: [SELF, ca_pem] }
CA_KEY: { get_property: [SELF, ca_key] }
Expand All @@ -118,6 +156,10 @@ node_types:
capability: tosca.capabilities.Node
relationship: org.ystia.yorc.linux.ansible.relationships.DependsOnTerraformRuntime
occurrences: [ 1, 1 ]
- statsd:
capability: org.alien4cloud.statsd.pub.capabilities.StatsdEndpoint
relationship: org.ystia.yorc.linux.ansible.relationships.ConnectsToStatsd
occurrences: [ 0, 1 ]

relationship_types:
org.ystia.yorc.linux.ansible.relationships.JoinConsulAgent:
Expand Down Expand Up @@ -231,3 +273,16 @@ relationship_types:
DATA_DIR: { get_property: [TARGET, data_dir] }
HOSTS_POOL: { get_property: [SOURCE, hosts] }
implementation: playbooks/configure_hostspool.yml

org.ystia.yorc.linux.ansible.relationships.ConnectsToStatsd:
derived_from: tosca.relationships.ConnectsTo
description: >
When Yorc is connected to statsd, we fill it's telemetry configuration
interfaces:
Configure:
post_configure_source:
inputs:
CONFIG_DIR: { get_property: [SOURCE, config_dir] }
STATSD_IP_ADDRESS: { get_attribute: [TARGET, statsd_endpoint, ip_address] }
STATSD_IP_PORT: { get_attribute: [TARGET, statsd_endpoint, port] }
implementation: playbooks/configure_telemetry_statsd.yml
5 changes: 5 additions & 0 deletions org/ystia/yorc/yorc/pub/types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ node_types:
type: string
required: true
default: /var/yorc
workers_number:
description: The number of workers to handle executions
type: integer
required: true
default: 30
private_key_content:
description: "Content of the default ssh private key used to connect on computes. Stored as ~/.ssh/yorc.pem"
type: string
Expand Down