Ubuntu default configuration sets up cn=admin,dn=example,dn=com as root dn for the backend, but requires SASL authentication as root to modify the online configuration. You can use:
sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config olcAccess
to list the ACL's for your configuration
to add your ldif file try:
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f "my.ldif"
assuming the LDAP server is on the local machine. If you want your original command to work, you would need to add the cn=admin,cn=config user and either specify her as the rootdn of the cn=config database or setup an ACL to grant her access.
I was unable to add the rootdn with the ldap tools, even as root, I was also unable to add/modify the ACLs for the cn=config DIT. I am assuming that while root is given manager access, it is not enough to add a rootDN. Therefore, to add rootDN for online configuration you need to edit the configuration manually. This is discouraged because it can break slapd.
You need to generate a password hash with slappasswd, for example "somesecret" slappasswd might generate {SSHA}Hg/mI0rBWab3HCysr55B4Ew7/QmK0LBa
Now you can add the RootDN. First stop slapd
sudo service slapd stop
next edit /etc/ldap/slapd.d/cn=config/olcDatabase={0}config.ldif using the editor of your choice (e.g. nano)
sudo nano /etc/ldap/slapd.d/cn\=config/olcDatabase\=\{0\}config.ldif
then add the following lines before the line "structuralObjectClass: olcDatabaseConfig"
olcRootDN: cn=admin,cn=config
olcRootPW: {SSHA}Hg/mI0rBWab3HCysr55B4Ew7/QmK0LBa
then restart slapd
sudo service slapd start
You can now modify the cn=config DIT with a simple bind using cn=admin,cn=config; however, I am not convinced that this is a good idea. I prefer to ssh into server and access configuration as root. Some however, argue that this defeats the entire advantage of an online configuration, where you can modify the configuration without stopping slapd using any LDAP browser as long as you have the necessary credentials.