Giter VIP home page Giter VIP logo

mailcow-ansiblerole's People

Contributors

0boro avatar domrim avatar fanchthesystem avatar felixoi avatar jonasc avatar leona-ya avatar maljes avatar n0emis avatar ntimo avatar poehlerflorian avatar sourcecode-glitch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mailcow-ansiblerole's Issues

Task "Generate mailcow.conf file" does not behave declaratively

In main.yml task Generate mailcow.conf file calls ./generate_config.sh but if that fails at any point, re-running the playbook does not rebuild mailcow.conf since that script checks if mailcow.conf is already installed so the config will be left broken and not as defined when calling.

Technically the playbook should respect the changes set when calling it and override the variables set in mailcow.conf, but that would also likely break stuff, so my suggest solution would be adding a check what the variables already exists and if they differ, then the playbook should probably exit with an error, since otherwise it will succeed and silently keep incorrect configuration.

role not working with ansible 2.10.11

Hello,

thanks for making this role available!

It seems due to some changes in ansible docker_container_info and docker_compose are no longer builtin.

On Ubuntu 20.04 with ansible installed via the ppa, I had to install the collections community.docker and community.netcommon (since the filter ipaddr was not available) and apply the following changes:

 diff --git a/tasks/main.yml b/tasks/main.yml
 index 581fea0..cc5f130 100755
 --- a/tasks/main.yml
 +++ b/tasks/main.yml
 @@ -9,7 +9,7 @@
  - name: Install required pip packages
    become: yes
    pip:
 -    name: docker
 +    name: docker-compose
      state: present
  
  - name: Check if mailcow installation directory exists
 @@ -56,13 +56,13 @@
  
  - name: Check if mailcow is running
    become: yes
 -  docker_container_info:
 +  community.docker.docker_container_info:
      name: "{{ mailcow__docker_compose_project_name }}_nginx-mailcow_1"
    register: mailcow_running
  
  - name: Start mailcow stack
    become: yes
 -  docker_compose:
 +  community.docker.docker_compose:
      project_src: "{{ mailcow__install_path }}"
      project_name: "{{ mailcow__docker_compose_project_name }}"
      state: present

I also had to change the pip installation from docker to docker-compose since, although I installed docker-compose before running this role it complained that the pip package was missing. Installing docker-compose via pip seems to pull in docker as a dependency. Which seems to satisfy all dependencies for community.docker.docker_compose.

Since I am rather new to ansible I don't know if it is possible to modify the role in a way that it works for ansible 2.9 and 2.10 - therefore I choose to create just an issue and not a PR.

After installing the collections and applying the three changes the role worked as expected.

best regards,

Paul

Failed to import the required Python library (netaddr)

When running the mailcow-ansiblerole on Ubuntu 22.04 I receive the following error:

fatal: [redacted]: FAILED! => {"msg": "Failed to import the required Python library (netaddr) on <redacted>'s Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

This occurs after setting mailcow__config_http_bind: 127.0.0.1. It seems to be caused by line 26 in mailcowconf.yml.

No matter if I install netaddr using apt install python3-netaddr or pipx install netaddr the error remains.

I did not override ansible_python_interpreter.

Add a License

It has Come to my attention that a lot of the mailcow apps don't have a license. Is it possible to add one?

Wrong container name in "running" check

I just tried to update mailcow and had the update task skipped. Looked like the container name was different on my system than the task check below:

name: "{{ mailcow__docker_compose_project_name }}_nginx-mailcow_1"

My containers were called "{{ mailcow__docker_compose_project_name }}-nginx-mailcow-1" (dashes instead of underscores). Not sure if my setup was just weird, and I already fixed it for me, but maybe there's more to it and others are affected.

Detection of pre-existing git repository broken

installing mailcow via this role just broke for me - the role checks whether /opt/mailcow-dockerized exists and only checks out git if the folder is not there yet.
I created a btrfs subvolume and mounted it to /opt/mailcow-dockerized beforehand...

I suggest checking for existance of /opt/mailcow/dockerized/.git instead - following up with a PR...

Add traefik support

Hello,
I'm actually working on Ansible since o discovered this tool, and i have to admit this is a good deployement tool
I would like to use that role to deploy my mailcow stack on my eventuals future server reinstallation (i mean we never know what can happen)
Only problem is that i use Traefik for quite everything, and if traefik usage with docker-compose is quite easy, using traefik with this ansible role is a bit more complicated, as it needs to edit the compose file, add an override, and, the easiest part as this is done with env, change mailcow.conf values.

I'll probably give a look into that from time to time, in case I can do it myself, but if someone manage to do a correct PR/MR to add the ability to use Traefik, it would be really nice :D

Support for Docker Compose plugin

Currently this role only supports the docker-compose standalone version. The Docker plugin version is installed automatically in the installation script as described https://docs.mailcow.email/i_u_m/i_u_m_install/#docker-compose these days. This role should at least support the Docker plugin version as of this.

@ntimo Your account is the only one which commited to this repo as part of the mailcow org. Could you clarify the term "The official ansible role" from the "About Me" section of this repository? I've the feeling that some things here are not up to date. I'd be happy to help out but would like to know how this role is handled currently. Looking at the repo only, it feels more like community-supported and not "official".

Installation infinitely stuck if not enough memory

Playbook main.yml calls generate_config.sh which checks the amount of available ram, if there is less than 2097152 (of some unit) the script will get infinitely stuck at row 105 and 125 on generate_config.sh

The play is currently like this:

- name: Generate mailcow.conf file
  shell: ./generate_config.sh
  environment:
    MAILCOW_HOSTNAME: "{{ mailcow__hostname }}"
    MAILCOW_TZ: "{{ mailcow__timezone }}"
    MAILCOW_BRANCH: "{{ mailcow__git_version }}"
  args:
    executable: /bin/bash
    chdir: "{{ mailcow__install_path }}"
    creates: mailcow.conf
  tags:
    - skip_ansible_lint

On Ansible role side I'd suggest for fixing it for example by adding a timeout, like below (didn't yet test) and additionally mentioning somewhere that the role does not support (yet) these cases where installed memory is less than x amount:

- name: Generate mailcow.conf file
  shell: ./generate_config.sh
  environment:
    MAILCOW_HOSTNAME: "{{ mailcow__hostname }}"
    MAILCOW_TZ: "{{ mailcow__timezone }}"
    MAILCOW_BRANCH: "{{ mailcow__git_version }}"
  args:
    executable: /bin/bash
    chdir: "{{ mailcow__install_path }}"
    creates: mailcow.conf
  tags:
    - skip_ansible_lint
  async: 60
  poll: 5

A proper fix would be to modify generate_config.sh to handle these situations without interactions.

hangs at "Generate mailcow.conf file" with < 2.5G of memory

The ./generate_config.sh script blocks on the clamd check when memory is < 2.5G and prompts the user to decide whether to skip clamd. With Ansible, this makes the task hang.

Instead, it should probably respect my mailcow__config_skip_clamd setting.

Publish in galaxy

The last publish of this role in Ansible Galaxy is over a year ago.
Could someone publish the latest state to galaxy as well please? :)

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.