Tuning magnetic frustration of nanomagnets in triangular-lattice geometry