Coder Social home page Coder Social logo

docker-awx-stack's Introduction

Hi 👋, I'm Alan Padierna

A passionate Software Engineer from Spain

alanpadi95

alanpadi95

  • 🔭 I’m currently working on Assure Project at DXC Technology

  • 👨‍💻 All of my projects are available at https://github.com/AlanPadi95

  • 💬 Ask me about React, Javascript, Python, C#, Java

  • 📫 How to reach me [email protected]

  • 📄 Know about my experiences

    • Product Engineer: Working for Assure product. I work with the Automation squad developing a solution to manage solutions deployed in AWS using Terraform to make infrastructure as code and JavaScript with React.js to develop the platform UI and backend.
    • Full Stack & Process Improvement & Automation Engineer: As a Process Improvement & Automation Engineer, I have to analyze different business processes to find where the excessive costs are, in terms of money and/or time. To solve this costs, I can change or automate a part or the whole process. As a Full-Stack Engineer, when an automation process is required, I have to do the complete Software Development Life Cycle to develop the best software solution for the costumer.
    • DevOps & Automation Engineer: Automation, administration and monitoring of the platforms involved in the Software Development Life Cycle.
    • Associate System Administrator: Administration of different machines and operative systems with unplanned tasks and tickets.

Connect with me:

alanpadi95 alan-padierna-fernández-199a48152

Languages and Tools:

arduino aws bash csharp css3 docker dotnet elasticsearch git go heroku html5 java javascript jenkins jest kibana linux mariadb mssql mysql nodejs oracle postgresql postman python react scikit_learn selenium sqlite tensorflow travisci vagrant

alanpadi95

 alanpadi95

alanpadi95

docker-awx-stack's People

Contributors

alanpadi95 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-awx-stack's Issues

[BUG] initdb: error: directory "/var/lib/postgresql/data" exists but is not empty If you want to create a new database system, either remove or empty the directory "/var/lib/postgresql/data" or run initdb with an argument other than "/var/lib/postgresql/data"

Problem description

On CentOS, when the stack is going to be deployed, the PostgreSQL service is always stopped because of an error creating the DB os using an existing DB.

Extra information

On MacOs, when I type docker stack deploy -c docker-compose.yml awx all services are up & running.

MacOS Docker version: Docker version 19.03.5, build 633a0ea
MacOS Docker Compose version: docker-compose version 1.25.4, build 8d51620a

Stack configuration

version: '3.7'
services:

  web:
    image: ansible/awx_web:9.1.0
    depends_on:
      - rabbitmq
      - memcached
      - postgres
    ports:
      - "8052:8052"
    hostname: awxweb
    user: root
    deploy:
      mode: replicated
      replicas: 1
    volumes:
      - "./config/SECRET_KEY.txt:/etc/tower/SECRET_KEY"
      - "./config/environment.sh:/etc/tower/conf.d/environment.sh"
      - "./config/credentials.py:/etc/tower/conf.d/credentials.py"
      - "./config/nginx.conf:/etc/nginx/nginx.conf:ro"
      - "./projects:/var/lib/awx/projects:rw"
      - "./inventories:/var/lib/awx/inventories:rw"
      # - "/etc/pki/ca-trust/source/anchors:/etc/pki/ca-trust/source/anchors:ro' }}"
      # - "ssl_certificate:/etc/nginx/awxweb.pem:ro"
    environment:
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''

  task:
    image: ansible/awx_task:9.1.0
    depends_on:
      - rabbitmq
      - memcached
      - web
      - postgres
    hostname: awx
    user: root
    deploy:
      mode: replicated
      replicas: 1
    volumes:
      - "./config/SECRET_KEY.txt:/etc/tower/SECRET_KEY"
      - "./config/environment.sh:/etc/tower/conf.d/environment.sh"
      - "./config/credentials.py:/etc/tower/conf.d/credentials.py"
      - "./projects:/var/lib/awx/projects:rw"
      # - "/etc/pki/ca-trust/source/anchors:/etc/pki/ca-trust/source/anchors:ro"
      # - "ssl_certificate:/etc/nginx/awxweb.pem:ro"
    environment:
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''

  rabbitmq:
    image: ansible/awx_rabbitmq
    ports:
      - "5672:5672"
      - "15672:15672"
    deploy:
      mode: replicated
      replicas: 1
    environment:
      RABBITMQ_DEFAULT_VHOST: "awx"
      RABBITMQ_DEFAULT_USER: "guest"
      RABBITMQ_DEFAULT_PASS: "changeme"
      RABBITMQ_ERLANG_COOKIE: "cookiemonster"
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''

  memcached:
    image: "memcached"
    ports:
      - "11211:11211"
    deploy:
      mode: replicated
      replicas: 1
    environment:
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''

  postgres:
    image: postgres
    user: root
    ports:
      - "5432:5432"
    deploy:
      mode: replicated
      replicas: 1
    volumes:
      - ./postgres/data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: awx
      POSTGRES_PASSWORD: changeme
      POSTGRES_DB: awx
      PGDATA: /var/lib/postgresql/data/pgdata
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''
  
  metricbeat:
    image: docker.elastic.co/beats/metricbeat:${ELASTIC_VERSION:-7.5.2}
    user: root
    environment:
      - KIBANA_HOST='${KIBANA_HOST}:5601'
      - ELASTIC_HOST='${ELASTIC_HOST}:9200'
      - ELASTICSEARCH_USERNAME=${ELASTICSEARCH_USERNAME-elastic}
      - ELASTICSEARCH_PASSWORD=${ELASTICSEARCH_PASSWORD-changeme}
      - AWX_DB_USER=${AWX_DB_USER:-awx}
      - AWX_DB_PASS=${AWX_DB_PASS:-changeme}
      - AWX_RABBITMQ_USER=${AWX_RABBITMQ_USER:-guest}
      - AWX_RABBITMQ_PASS=${AWX_RABBITMQ_PASS:-changeme}
    configs:
      - source: metricbeat_config
        target: /usr/share/metricbeat/metricbeat.yml
    command: -system.hostfs=/hostfs
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
      - /proc:/hostfs/proc:ro
      - /:/hostfs:ro
      - ./metricbeat/dashboards:/usr/share/metricbeat/kibana/7/dashboard:ro
    deploy:
      mode: replicated
      replicas: 1

configs:
  metricbeat_config:
    file: ./metricbeat/config/metricbeat.yml

Docker setup

Docker version 19.03.5, build 633a0ea
docker-compose version 1.25.0, build 0a186604

Docker logs

initdb: error: directory "/var/lib/postgresql/data" exists but is not empty If you want to
create a new database system, either remove or empty the directory
"/var/lib/postgresql/data" or run initdb with an argument other than
"/var/lib/postgresql/data". initdb: error: directory "/var/lib/postgresql/data" exists but
is not empty If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/data" or run initdb with an argument other than
"/var/lib/postgresql/data". The files belonging to this database system will be owned
by user "postgres". This user must also own the server process.

[WARNING]: The required python-logstash is not installed. pip install python-logstash

Problem description

AWX does not use the pip2 or pip3 installed instances.

Extra information

When you are going to install pip, the system returns you the message: pip is already installed but when you're going to use pip, the system returns you pip command not found.

Stack configuration

awx_web Dockerfile
FROM ansible/awx_task

USER root

RUN sudo pip install logstash
RUN sudo pip install python3-logstash
awx_task Dockerfile
FROM ansible/awx_task

USER root

RUN sudo pip install logstash
RUN sudo pip install python3-logstash
docker-compose
version: '3.7'
services:

  web:
    image: alanpadi95/awx_web
    build: ./awx_web
    depends_on:
      - rabbitmq
      - memcached
      - postgres
    ports:
      - "8052:8052"
    hostname: awxweb
    user: root
    deploy:
      mode: replicated
      replicas: 1
    volumes:
      - "./config/SECRET_KEY.txt:/etc/tower/SECRET_KEY"
      - "./config/environment.sh:/etc/tower/conf.d/environment.sh"
      - "./config/credentials.py:/etc/tower/conf.d/credentials.py"
      - "./config/nginx.conf:/etc/nginx/nginx.conf:ro"
      - "./projects:/var/lib/awx/projects:rw"
      - "./inventories:/var/lib/awx/inventories:rw"
      # - "/etc/pki/ca-trust/source/anchors:/etc/pki/ca-trust/source/anchors:ro' }}"
      # - "ssl_certificate:/etc/nginx/awxweb.pem:ro"
    environment:
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''
      LOGSTASH_PORT: "5000"
      LOGSTASH_SERVER: "localhost"
      LOGSTASH_TYPE: "ansible"
    networks:
      - awx
  
  task:
    image: alanpadi95/awx_task
    build: ./awx_task
    depends_on:
      - rabbitmq
      - memcached
      - web
      - postgres
    hostname: awx
    user: root
    deploy:
      mode: replicated
      replicas: 1
    volumes:
      - "./config/SECRET_KEY.txt:/etc/tower/SECRET_KEY"
      - "./config/environment.sh:/etc/tower/conf.d/environment.sh"
      - "./config/credentials.py:/etc/tower/conf.d/credentials.py"
      - "./projects:/var/lib/awx/projects:rw"
      # - "/etc/pki/ca-trust/source/anchors:/etc/pki/ca-trust/source/anchors:ro"
      # - "ssl_certificate:/etc/nginx/awxweb.pem:ro"
    environment:
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''
      LOGSTASH_PORT: "5000"
      LOGSTASH_SERVER: "localhost"
      LOGSTASH_TYPE: "ansible"
    networks:
      - awx
  

  rabbitmq:
    image: ansible/awx_rabbitmq
    ports:
      - "5672"
      - "15672"
    deploy:
      mode: replicated
      replicas: 1
    environment:
      RABBITMQ_DEFAULT_VHOST: "awx"
      RABBITMQ_DEFAULT_USER: "guest"
      RABBITMQ_DEFAULT_PASS: "changeme"
      RABBITMQ_ERLANG_COOKIE: "cookiemonster"
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''
    networks:
      - awx

  memcached:
    image: "memcached"
    ports:
      - "11211"
    deploy:
      mode: replicated
      replicas: 1
    environment:
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''
    networks:
      - awx  
  
  postgres:
    image: postgres
    user: root
    ports:
      - "5432"
    deploy:
      mode: replicated
      replicas: 1
    volumes:
      - ./postgres/data:/var/lib/postgresql/data:Z
    environment:
      POSTGRES_USER: awx
      POSTGRES_PASSWORD: changeme
      POSTGRES_DB: awx
      PGDATA: /var/lib/postgresql/data/pgdata
      http_proxy: ''
      https_proxy: ''
      no_proxy: ''
    networks:
      - awx
  
  metricbeat:
    image: docker.elastic.co/beats/metricbeat:${ELASTIC_VERSION:-7.5.2}
    user: root
    environment:
      - KIBANA_HOST='${KIBANA_HOST}:5601'
      - ELASTIC_HOST='${ELASTIC_HOST}:9200'
      - ELASTICSEARCH_USERNAME=${ELASTICSEARCH_USERNAME-elastic}
      - ELASTICSEARCH_PASSWORD=${ELASTICSEARCH_PASSWORD-changeme}
      - AWX_DB_USER=${AWX_DB_USER:-awx}
      - AWX_DB_PASS=${AWX_DB_PASS:-changeme}
      - AWX_RABBITMQ_USER=${AWX_RABBITMQ_USER:-guest}
      - AWX_RABBITMQ_PASS=${AWX_RABBITMQ_PASS:-changeme}
    configs:
      - source: metricbeat_config
        target: /usr/share/metricbeat/metricbeat.yml
    command: -system.hostfs=/hostfs
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
      - /proc:/hostfs/proc:ro
      - /:/hostfs:ro
      - ./metricbeat/dashboards:/usr/share/metricbeat/kibana/7/dashboard:ro
    deploy:
      mode: replicated
      replicas: 1
    networks:
      - awx

configs:
  metricbeat_config:
    file: ./metricbeat/config/metricbeat.yml

networks:
  awx:
    driver: overlay

AWX v10

Problem description

With the new architecture of AWX v10, there are API issues when you want to run, a job.
The new architecture removes RabbitMQ service and add Redis service to make the architecture more simple.

Extra information

https://groups.google.com/forum/#!topic/awx-project/lRnm2vB1oEQ

Solution

I'll try to develop the new AWX compose file to deploy the new architecture with no issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.