Select Page

NETWAYS Blog

You missed out OSDC? — Sign up for OSCamp!

Hey folks!

The OSDC 2019 is in full swing! You didn’t get to be part of the happy DevOps crowd meeting in Berlin?

Here‘s your chance to find some relief by participating in the next big Open Source thing happening in Berlin this week: Be part of our OSCamp on Ansible!

But you gotta be really fast to grab one of the few remaining seats at opensourcecamp.de

To get a glimpse of how it feels to be one of the OSDC guys, just take a look at the photos published so far on our Twitter channel. And start getting excited what’s coming up at the OSCamp…

See you in Berlin on Thursday!

Pamela Drescher
Pamela Drescher
Head of Marketing

Seit Dezember 2015 ist Pamela Anführerin des Marketing Teams. Mit ihrer stetig wachsenden Mannschaft arbeitet sie daran, NETWAYS nicht nur erfolgreicher, sondern auch immer schöner zu machen. Privat ist sie Dompteurin einer Horde von drei Kindern, zwei Pferden, drei Katzen und einem Hund. Für Langeweile bleibt also keine Zeit!

Ansible can talk to your favorite API

Ansible is a powerful opensource config management and deployment tool, which can manage nearly any situtation. In many “DevOp” scenarios we come across multiple platforms, which we need to combine. Mostly applications provide an REST Api or web connectors to manage resources, jobs and deployments within the product.
Ansible provides various modules which can execute commands at specific APIs, such as the vmware-guest-module to create virtual machines or the jenkins-job-module to manage jobs over the Jenkins API.
In cases where no module is available, we can use the module “uri”.

The module takes several parameters, of which the “url” is the only required one. For this example I picked an example online API “http://dummy.restapiexample.com/”.
To get a list of all employees we use the method GET on , the header Accept: application/json and register the content.


- name: Make requests to example api
  hosts: localhost
  connection: local
  tasks:
    - name: list employees
      uri:
        method: GET
        url: "http://dummy.restapiexample.com/api/v1/employees"
        return_content: yes
        headers:
          Accept: application/json
      register: response

    - debug:
        msg: "{{ response.content }}"

# Result
TASK [list employees] *************************************************************************
ok: [localhost]

TASK [debug] **********************************************************************************
ok: [localhost] => {
    "msg": [
        {
            "employee_age": "23",
            "employee_name": "test",
            "employee_salary": "46000",
            "id": "12008",
            "profile_image": ""
        }
    ]
}

Now we create a new user in our application, for this we talk to a different url and send a body with our user to create.
When the api accepts JSON I use a little trick to generate a valid json body out of yaml variables with the Ansible filter to_json

For this we create a variable with the same key value structure as the API expects it, in this case the structure looks like this {“name”:”test”,”salary”:”123″,”age”:”23″}.


- name: Make requests to example api
  hosts: localhost
  connection: local
  vars:
    data:
      chris:
        name: chris
        salary: 46000
        age: 27
      jessy:
        name: jessy
        salary: 70000
        age: 30
  tasks:
    - name: create employee
      uri:
        method: POST
        url: "http://dummy.restapiexample.com/api/v1/create"
        return_content: yes
        headers:
          Accept: application/json
        body_format: json
        body: "{{ item.value | to_json }}" //Render valid json from each dictionary in the variable data.
      with_dict: "{{ data }}"
      register: post_content

    - debug:
        msg: "{{ item.content }}"
      with_items: "{{ post_content.results }}"

# Result
ansible-playbook create_user.yaml

PLAY [Make requests to example api] ********************************************************************

TASK [Gathering Facts] *********************************************************************************
ok: [localhost]

TASK [create employee] *********************************************************************************
ok: [localhost] => (item={'value': {u'salary': 46000, u'age': 27, u'name': u'chris'}, 'key': u'chris'})
ok: [localhost] => (item={'value': {u'salary': 70000, u'age': 30, u'name': u'jessy'}, 'key': u'jessy'})

With this information given, you can now explore your own favorite API and hopefully reduce your daily tasks as simple Ansible playbooks.

Check out our Blog for more awesome posts and if you need help with Ansible send us a message!

Thilo Wening
Thilo Wening
Manager Consulting

Thilo hat bei NETWAYS mit der Ausbildung zum Fachinformatiker, Schwerpunkt Systemadministration begonnen und unterstützt nun nach erfolgreich bestandener Prüfung tatkräftig die Kollegen im Consulting. In seiner Freizeit ist er athletisch in der Senkrechten unterwegs und stählt seine Muskeln beim Bouldern. Als richtiger Profi macht er das natürlich am liebsten in der Natur und geht nur noch in Ausnahmefällen in die Kletterhalle.

Sign up for ANSIBLE Automation

Get your OSCamp badge now to Ansibuild your Automation skills!

Meet Anton Vorobiev and learn how to reuse your existing Ansible roles for your Kubernetes apps. Anton will show you how to combine them with the K8s’ operators.

Learn all about Automated Tests of Ansible code with GitLab, Vagrant, VirtualBox and Ansible from Klaus Franken. The Engineer at ING Germany will introduce you to the triple-A concept! Curious? Join his talk at OSCAMP!

Ansibuild your systems! Don’t miss Toshaan Bharvani showing how roles can build a virtual machine or containers for deployment and much more.

You want to provide End-to-End Automation for the Enterprise?
Check out Nikhil Kathole‘s presentation. The Quality Engineer at Red Hat and upstream contributor demonstrates how Ansible and Foreman integrate!

Get to know how to automate your things and learn best practices, tips and tricks with Ansible!

Find out more at opensourcecamp.de & register now!

Pamela Drescher
Pamela Drescher
Head of Marketing

Seit Dezember 2015 ist Pamela Anführerin des Marketing Teams. Mit ihrer stetig wachsenden Mannschaft arbeitet sie daran, NETWAYS nicht nur erfolgreicher, sondern auch immer schöner zu machen. Privat ist sie Dompteurin einer Horde von drei Kindern, zwei Pferden, drei Katzen und einem Hund. Für Langeweile bleibt also keine Zeit!

OSCAMP on Ansible: Agenda out now!

 

This time Open Source Camp will deal with the automation tool Ansible. We are very happy to announce the third edition’s agenda!

You will get the chance to meet and learn from

  • Anton Vorobiev | vorobiev.cloud
  • Martin Schurz | T-Systems Multimedia Solutions
  • Felix Frank | The unbelievable Machine Company
  • and other Ansible experts

Their topics: Reusing Ansible Roles as Kubernetes Operators, the free Ansible Tower AWX in practice and Icinga configuration with Ansible. Get to know how to automate your things and learn best practices, tips and tricks from the experts!

Check out the whole PROGRAM and don’t forget to get your TICKET!

Config Management Camp Ghent 2019

Ich habe dieses Jahr die erste Gelegenheit bekommen, mich mit meinen Kollegen und meinem Chef am Configuration Management Camp im Ghent zwischen 4. und 6. Februar zu beteiligen. Wir sind am 3. Februar am Abend in Ghent angekommen und durch die Stadt spazieren gegangen. Ghent hat uns sehr beeindruckt: Nicht nur die Sauberkeit der Straßen, sondern auch die Verbindung von alten und neuen Gebäuden haben Ghent besonders schön wirken lassen.

DevOps und Konfigurationsmanagement

Aber der Höhepunkt war das Camp: Es gab fast 1000 Teilnehmer aus der ganzen Welt. Die Vorträge waren sehr informativ und gingen hauptsächlich um DevOps und Konfigurationsmanagement ( Puppet, Ansible, Chef, Foreman). Viele Referenten haben sowohl ihre Erfahrungen sowie zuletzt aufgekommene und gelöste Probleme in ihrer Firma geteilt, als auch neue Features im Automation- und Konfigurationsmanagement-Feld vorgestellt. Am dritten Tag nahm ich mit meinem Kollegen und Ausbilder auf dem Foreman Construction Day Workshop teil. Wir haben uns in Gruppen praktisch mit “Foreman” beschäftigt. Am Ende des Tages haben einige Foreman-Entwickler und Teilnehmer über Wünsche, Verbesserungen und kommende Features gesprochen.

Ich empfehle jedem, der Interesse am Konfigurationsmanagement hat, das nächste Camp zu besuchen und belgische Waffeln und Bier auf jeden Fall zu probieren. Die sind sehr, sehr lecker.

 

 

 

 

 

 

 

Afeef Ghannam
Afeef Ghannam
Systems Engineer

Afeef hat seine Ausbildung Als Fachinformatiker in Richtung Systemintegration im Juli 2020 bei NETWAYS absolviert, seitdem unterstützt er die Kolleg:innen im Operations Team der NETWAYS Professional Services bei der Betriebsunterstützung. Nach der Arbeit macht er gerne Sport, trifft Freunde oder mag es Filme zu schauen.