opsbro
opsbro copied to clipboard
Ops Best friend
``` # Rajout de lignes avec un duplicate for each - name: Add a few lines in xwiki.cfg file lineinfile: dest: "{{ tomcat8_path }}/webapps/{{ xwiki_path }}/WEB-INF/xwiki.cfg" line: "{{ item }}"...
Voir si on a un intérêt à passer sur une gestion complète du DNs en python: https://medium.com/@paktek123/write-your-own-dns-server-in-python-hosted-on-kubernetes-3febacf33b9b
``` # delegate? - name: Configure filebeat log collection in central logstash template: src: nginx.conf.j2 dest: /etc/logstash/conf.d/{{inventory_hostname}}_nginx.conf notify: "notify logstash for restart" delegate_to: '{{elk_server}}' ```
``` # NOTIFY? - name: Configure metricbeat to collect docker stats template: src: metricbeat.yml.j2 dest: /etc/metricbeat/metricbeat.yml notify: "notify metricbeat for restart" ```
``` # Check that the version is the latest - name: Install Filebeat yum: name: filebeat state: latest ```
``` # Rajout de la clé, utile? - name: Add Elasticsearch key to keystore rpm_key: state: present key: https://artifacts.elastic.co/GPG-KEY-elasticsearch ```
``` # Repository add avec déclaration de clé - name: Add elasticsearch repository yum_repository: name: elasticsearch-5.x description: elasticsearch repository for 5.x packages baseurl: https://artifacts.elastic.co/packages/5.x/yum gpgkey: https://artifacts.elastic.co/GPG-KEY-elasticsearch ```
``` # Service mais avec un état RESTART - name: Start and enable tomcat8 systemd: state: restarted enabled: yes daemon_reload: yes name: tomcat8 ```
``` # Partial avec juste une ligne - name: add setenv.sh to configure Xmx and ALLOW_ENCODED_SLASH lineinfile: path: "{{ tomcat8_path }}/bin/setenv.sh" create: yes line: CATALINA_OPTS="-Xmx1024m -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true" ```
``` # Partial avec insersion APRES - name: UTF-8 URI encoding lineinfile: path: "{{ tomcat8_path }}/conf/server.xml" state: present line: ' URIEncoding="UTF-8"' insertafter: "