- name: Configure bastion
  hosts: bastion
  become: true
  pre_tasks:
    - file:
        path: /root/.ssh
        state: directory
        owner: root
        mode: 0700

  roles:
    - common
    - role: dd-agent
      tags:
        - monitoring
      when: secrets is defined
    - bastion
    - role: datadog-builder
      datadog_builder_secrets:
        api_key: "{{ secrets.datadog.api_key }}"
        app_key: "{{ secrets.datadog.ansible_app_key }}"
      when: secrets is defined
    - role: ansible-runner
      ansible_runner_job: system-ansible
      ansible_playbook: bastion.yml
      ansible_inventory: /opt/source/system-ansible/inventory/bastion-production
      ansible_runner_user: root
      ansible_runner_repo: "{{ hoist_repo }}"
      ansible_runner_minute: "*/15"
    - role: ansible-runner
      ansible_playbook: install-ci.yml
      ansible_inventory: /opt/source/cideploy/inventory/ci
      ansible_runner_job: cideploy
      ansible_runner_user: cideploy
      ansible_remote_user: ubuntu
      ansible_runner_repo: "{{ hoist_repo }}"
      ansible_runner_minute: "*/15"

- name: Configure bastion
  hosts: bastion
  become: true
  pre_tasks:
    - file:
        path: /root/.ssh
        state: directory
        owner: root
        mode: 0700

  roles:
    - common
    - role: dd-agent
      tags:
        - monitoring
      when: secrets is defined
    - bastion
    - role: datadog-builder
      datadog_builder_secrets:
        api_key: "{{ secrets.datadog.api_key }}"
        app_key: "{{ secrets.datadog.ansible_app_key }}"
      when: secrets is defined
    - role: logrotate
      logrotate_configs:
        - name: datadog-builder
          path: /var/log/datadog-builder/*log
          options:
            - compress
            - missingok
            - rotate 30
            - daily
            - notifempty
      when: secrets is defined
    - role: ansible-runner
      ansible_runner_job: system-ansible
      ansible_playbook: bastion.yml
      ansible_inventory: /opt/source/system-ansible/inventory/bastion-production
      ansible_runner_user: root
      ansible_runner_repo: "{{ hoist_repo }}"
      ansible_runner_minute: "*/15"
    - role: ansible-runner
      ansible_playbook: install-ci.yml
      ansible_inventory: /opt/source/cideploy/inventory/ci
      ansible_runner_job: cideploy
      ansible_runner_user: cideploy
      ansible_remote_user: ubuntu
      ansible_runner_repo: "{{ hoist_repo }}"
      ansible_runner_minute: "*/15"

Add logrotate to datadog-builder logs
Add logrotate to datadog-builder logs

Signed-off-by: Bradon Kanyid <b3a3918db743ade51d08c05c242b2eafd1902905@gmail.com>
