Search code examples
mariadbsymlinksalt-project

MariaDB symbolic link using SaltStack


I'm trying to use SaltStack to setup configuration on a MariaDB instance. I'm trying to make a symbolic link equivalent to this command

ln -s /var/lib/mysql/dbaas/mysql_client.cnf /etc/my.cnf

Is that the right salt syntax ?

   link-mysql-client-cnf:
      file.symlink:
      - name: /etc/my.cnf
      - target: /var/lib/mysql/dbaas/mysql_client.cnf
      - force: True

For some reason the symlink fails because my.cnf already exists, I read the documentation and set Force to True but it didn't work. Any suggestions please?


Solution

  • I solved the issue. What was causing the problem is that the engine was created before putting force=True and that was cached even when I modified the salt script. My advice is to clear out the engine and start-over by creating an engine and an instance anytime you change the salt.